summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Penz <peter.penz19@gmail.com>2012-02-03 08:57:18 (GMT)
committerPeter Penz <peter.penz19@gmail.com>2012-02-03 15:14:09 (GMT)
commit6f65a1745caccc1fe27522a001592a3315325084 (patch)
tree2a49ac2a4f89f55e14b551bd90d4cab9038697df
parent5e3942838e2214c4ac7ca7096866612deb9389f1 (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
-rw-r--r--dolphin/src/kitemviews/kfileitemmodelrolesupdater.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/dolphin/src/kitemviews/kfileitemmodelrolesupdater.cpp b/dolphin/src/kitemviews/kfileitemmodelrolesupdater.cpp
index 0c204e4..14e7f00 100644
--- a/dolphin/src/kitemviews/kfileitemmodelrolesupdater.cpp
+++ b/dolphin/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;
}
}