mirror of
https://invent.kde.org/system/dolphin
synced 2024-10-28 03:21:56 +00:00
Fix size of directories if a subdir fails to open
If opening the directory fails, it returns -1 as size. Don't add that to the
parent's total size.
(cherry picked from commit a6490755ca
)
This commit is contained in:
parent
a81b287e7a
commit
50b9913233
|
@ -71,7 +71,10 @@ KDirectoryContentsCounterWorker::CountResult walkDir(const QString &dirPath,
|
||||||
}
|
}
|
||||||
if (dirEntry->d_type == DT_DIR) {
|
if (dirEntry->d_type == DT_DIR) {
|
||||||
// recursion for dirs
|
// recursion for dirs
|
||||||
size += walkDir(nameBuf, countHiddenFiles, countDirectoriesOnly, dirEntry, allowedRecursiveLevel - 1).size;
|
auto subdirResult = walkDir(nameBuf, countHiddenFiles, countDirectoriesOnly, dirEntry, allowedRecursiveLevel - 1);
|
||||||
|
if (subdirResult.size > 0) {
|
||||||
|
size += subdirResult.size;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue