diff options
| author | Peter Penz <[email protected]> | 2012-06-09 13:34:27 +0200 |
|---|---|---|
| committer | Peter Penz <[email protected]> | 2012-06-09 13:37:42 +0200 |
| commit | dbf233ea28fc895e9e4c235cd95a9adba0c977a8 (patch) | |
| tree | 5b0c6ce65f05d0e53f0ec7e7aa109230308dcafc | |
| parent | 57cde56158f6dd3bf198fb6ae1fca51e96038919 (diff) | |
Folders Panel: Also count directory links
... otherwise no expansion toggle will be shown. The implementation
is a compromise between performance and correctness: If the directory
contains links that are not directories, an unnecessary expansion
toggle will be shown. But this is better than showing no expansion
toggle in case if the directory contains links that point to other
directories.
BUG: 299997
FIXED-IN: 4.9.0
| -rw-r--r-- | src/kitemviews/kfileitemmodelrolesupdater.cpp | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/kitemviews/kfileitemmodelrolesupdater.cpp b/src/kitemviews/kfileitemmodelrolesupdater.cpp index 5418c3f9c..e07d1135e 100644 --- a/src/kitemviews/kfileitemmodelrolesupdater.cpp +++ b/src/kitemviews/kfileitemmodelrolesupdater.cpp @@ -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; } } |
