]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/dolphinviewcontainer.cpp
Fix the reproducible problem after the fix:
[dolphin.git] / src / dolphinviewcontainer.cpp
index c30b2d0bce7ccc4dd75bb6a1c3286e67873de604..a2902afd7e547839d74e9ef2e716aad71beded7b 100644 (file)
@@ -136,9 +136,11 @@ DolphinViewContainer::DolphinViewContainer(DolphinMainWindow* mainWindow,
             this, SLOT(showInfoMessage(const QString&)));
     connect(m_view, SIGNAL(itemTriggered(KFileItem)),
             this, SLOT(slotItemTriggered(KFileItem)));
+    connect(m_view, SIGNAL(startedPathLoading(const KUrl&)),
+            this, SLOT(saveRootUrl(const KUrl&)));
 
     connect(m_urlNavigator, SIGNAL(urlChanged(const KUrl&)),
-            m_view, SLOT(setUrl(const KUrl&)));
+            this, SLOT(restoreView(const KUrl&)));
 
     m_statusBar = new DolphinStatusBar(this, url);
     connect(m_view, SIGNAL(urlChanged(const KUrl&)),
@@ -450,18 +452,8 @@ void DolphinViewContainer::changeNameFilter(const QString& nameFilter)
     adjustedFilter.insert(0, '*');
     adjustedFilter.append('*');
 
-    // Use the ProxyModel to filter:
-    // This code is #ifdefed as setNameFilter behaves
-    // slightly different than the QSortFilterProxyModel
-    // as it will not remove directories. I will ask
-    // our beloved usability experts for input
-    // -- z.
-#if 0
     m_dirLister->setNameFilter(adjustedFilter);
     m_dirLister->emitChanges();
-#else
-    m_proxyModel->setFilterRegExp(nameFilter);
-#endif
 
     updateStatusBar();
 }
@@ -491,6 +483,17 @@ void DolphinViewContainer::activate()
     setActive(true);
 }
 
+void DolphinViewContainer::restoreView(const KUrl& url)
+{
+    m_view->updateView(url, m_urlNavigator->savedRootUrl());
+}
+
+void DolphinViewContainer::saveRootUrl(const KUrl& url)
+{
+    Q_UNUSED(url);
+    m_urlNavigator->saveRootUrl(m_view->rootUrl());
+}
+
 void DolphinViewContainer::slotItemTriggered(const KFileItem& item)
 {
     // Prefer the local path over the URL.