]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/dolphinviewcontainer.cpp
prevent that a column with an invalid root index shows the root column temporary...
[dolphin.git] / src / dolphinviewcontainer.cpp
index c30b2d0bce7ccc4dd75bb6a1c3286e67873de604..9a358b2fffd195a0cd8b9ac10f3195984779ad36 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(rootUrlChanged(const KUrl&)),
+            m_urlNavigator, 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&)),
@@ -491,6 +493,12 @@ void DolphinViewContainer::activate()
     setActive(true);
 }
 
+void DolphinViewContainer::restoreView(const KUrl& url)
+{
+    m_view->setRootUrl(m_urlNavigator->savedRootUrl());
+    m_view->setUrl(url);
+}
+
 void DolphinViewContainer::slotItemTriggered(const KFileItem& item)
 {
     // Prefer the local path over the URL.