]> cloud.milkyroute.net Git - dolphin.git/commitdiff
KDirectoryContentsCounter: fix support of symlinks dir
authorMéven Car <meven29@gmail.com>
Thu, 5 Nov 2020 06:58:24 +0000 (07:58 +0100)
committerMéven Car <meven29@gmail.com>
Sat, 7 Nov 2020 06:21:11 +0000 (06:21 +0000)
BUG: 428712
FIXED-IN: 20.12

src/kitemviews/private/kdirectorycontentscounter.cpp

index d33277a3b9d45c86bb9ecc69c5029023b3600aa6..a2a27ad28707717931119b7387f5f86ff74c3668 100644 (file)
@@ -115,7 +115,7 @@ void KDirectoryContentsCounter::slotResult(const QString& path, int count, long
     }
 
     // sends the results
-    Q_EMIT result(resolvedPath, count, size);
+    Q_EMIT result(path, count, size);
 }
 
 void KDirectoryContentsCounter::slotDirWatchDirty(const QString& path)
@@ -160,11 +160,12 @@ void KDirectoryContentsCounter::slotItemsRemoved()
 
 void KDirectoryContentsCounter::startWorker(const QString& path)
 {
-    const bool alreadyInCache = s_cache->contains(path);
+    const QString resolvedPath = QFileInfo(path).canonicalFilePath();
+    const bool alreadyInCache = s_cache->contains(resolvedPath);
     if (alreadyInCache) {
         // fast path when in cache
         // will be updated later if result has changed
-        const auto pair = s_cache->value(path);
+        const auto pair = s_cache->value(resolvedPath);
         Q_EMIT result(path, pair.first, pair.second);
     }