┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPeter Penz <[email protected]>2012-02-03 09:57:18 +0100
committerPeter Penz <[email protected]>2012-02-03 16:15:22 +0100
commite20a6e59ea2313f9121f3fda5c9c5a4fa048605e (patch)
treed21228640fb676e2fecd41835bc5f4f9cad54cf4 /src
parent17af97df2487a46a8b35804b7bf70b46c67ecf80 (diff)
Folders Panel: Show expansion toggles for directories on ISO-images
When counting the number of sub-directories consider unknown file types as potential directories. In the "worst case" an expansion toggle will be shown although the directory contains only files, however from a performance point of view this seems to be an acceptable compromise. BUG: 292642 FIXED-IN: 4.8.1
Diffstat (limited to 'src')
-rw-r--r--src/kitemviews/kfileitemmodelrolesupdater.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/kitemviews/kfileitemmodelrolesupdater.cpp b/src/kitemviews/kfileitemmodelrolesupdater.cpp
index 0c204e474..14e7f00ff 100644
--- a/src/kitemviews/kfileitemmodelrolesupdater.cpp
+++ b/src/kitemviews/kfileitemmodelrolesupdater.cpp
@@ -839,7 +839,9 @@ int KFileItemModelRolesUpdater::subItemsCount(const QString& path) const
}
}
- if (!showFoldersOnly || dirEntry->d_type == DT_DIR) {
+ // If only directories are counted, consider an unknown file type also
+ // as directory instead of trying to do an expensive stat() (see bug 292642).
+ if (!showFoldersOnly || dirEntry->d_type == DT_DIR || dirEntry->d_type == DT_UNKNOWN) {
++count;
}
}