]> cloud.milkyroute.net Git - dolphin.git/commitdiff
Assure that no endless searching is done if a link points to a parent directory
authorPeter Penz <peter.penz19@gmail.com>
Sun, 16 Jan 2011 12:38:45 +0000 (12:38 +0000)
committerPeter Penz <peter.penz19@gmail.com>
Sun, 16 Jan 2011 12:38:45 +0000 (12:38 +0000)
CCBUG: 263262
FIXED-IN: 4.6.0

svn path=/trunk/KDE/kdebase/apps/; revision=1214807

src/search/filenamesearchprotocol.cpp

index f50d9ebd98b8ed95dc8e746be335ed29a54ba1e6..8464205ff34b251ee065bb273a76df9094acd0c3 100644 (file)
@@ -97,7 +97,18 @@ void FileNameSearchProtocol::searchDirectory(const KUrl& directory)
         }
 
         if (item.isDir()) {
         }
 
         if (item.isDir()) {
-            pendingDirs.append(item.url());
+            bool skipDir = false;
+            const KUrl itemDir = item.url();
+            if (item.isLink()) {
+                // Assure that no endless searching is done if a link points
+                // to a parent directory
+                const KUrl linkDestDir = item.linkDest();
+                skipDir = linkDestDir.isParentOf(itemDir);
+            }
+
+            if (!skipDir) {
+                pendingDirs.append(itemDir);
+            }
         }
     }
     listEntry(KIO::UDSEntry(), true);
         }
     }
     listEntry(KIO::UDSEntry(), true);