]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/kitemviews/kfileitemmodelrolesupdater.cpp
Folders Panel: Show expansion toggles for directories on ISO-images
[dolphin.git] / src / kitemviews / kfileitemmodelrolesupdater.cpp
index 0c204e4745c0b1301c7c62987e1eebbbfcf67837..14e7f00ff7290c136471e92556054ca3ca81a22b 100644 (file)
@@ -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;
             }
         }