]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/kitemviews/kfileitemmodelrolesupdater.cpp
Folders Panel: Also count directory links
[dolphin.git] / src / kitemviews / kfileitemmodelrolesupdater.cpp
index 5418c3f9ce624761188b8801d3e65f980e86ce88..e07d1135e78f0994a191ccb3b9f39f88501e68a7 100644 (file)
@@ -1085,9 +1085,14 @@ int KFileItemModelRolesUpdater::subItemsCount(const QString& path) const
                 }
             }
 
-            // 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) {
+            // If only directories are counted, consider an unknown file type and links also
+            // as directory instead of trying to do an expensive stat()
+            // (see bugs 292642 and 299997).
+            const bool countEntry = !showFoldersOnly ||
+                                    dirEntry->d_type == DT_DIR ||
+                                    dirEntry->d_type == DT_LNK ||
+                                    dirEntry->d_type == DT_UNKNOWN;
+            if (countEntry) {
                 ++count;
             }
         }