]> cloud.milkyroute.net Git - dolphin.git/commitdiff
fixed "duplicate items issue" for the column view (don't invoke KDirLister::openUrl...
authorPeter Penz <peter.penz19@gmail.com>
Fri, 30 Mar 2007 04:51:06 +0000 (04:51 +0000)
committerPeter Penz <peter.penz19@gmail.com>
Fri, 30 Mar 2007 04:51:06 +0000 (04:51 +0000)
svn path=/trunk/KDE/kdebase/apps/; revision=647979

src/dolphinview.cpp

index 030a6abaec8231ec8eba7e4d4b7c714fff8c71c1..8a102c94fb0e7f28fda8590accdbfd46aa178004 100644 (file)
@@ -841,17 +841,29 @@ void DolphinView::startDirLister(const KUrl& url, bool reload)
     m_blockContentsMovedSignal = true;
     m_dirLister->stop();
 
+    bool openDir = true;
     bool keepOldDirs = isColumnViewActive() && !reload;
     if (keepOldDirs) {
-        const KUrl& dirListerUrl = m_dirLister->url();
-        if ((dirListerUrl == url) || !m_dirLister->url().isParentOf(url)) {
-            // The current URL is not a child of the dir lister
-            // URL. This may happen when e. g. a bookmark has been selected
-            // and hence the view must be reset.
-            keepOldDirs = false;
+        if (m_dirLister->directories().contains(url)) {
+            // The dir lister contains the directory already, so
+            // KDirLister::openUrl() may not been invoked twice.
+            m_dirLister->updateDirectory(url);
+            openDir = false;
         }
+        else {
+            const KUrl& dirListerUrl = m_dirLister->url();
+            if ((dirListerUrl == url) || !m_dirLister->url().isParentOf(url)) {
+                // The current URL is not a child of the dir lister
+                // URL. This may happen when e. g. a bookmark has been selected
+                // and hence the view must be reset.
+                keepOldDirs = false;
+            }
+        }
+    }
+
+    if (openDir) {
+        m_dirLister->openUrl(url, keepOldDirs, reload);
     }
-    m_dirLister->openUrl(url, keepOldDirs, reload);
 }
 
 QString DolphinView::defaultStatusBarText() const