]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/dolphinviewcontainer.cpp
Fixed regression when refactoring the Information Panel: Don't forget to give a visua...
[dolphin.git] / src / dolphinviewcontainer.cpp
index 9f61360d73a3db98b5305c92a2d08ae2c10ee186..d8f90f3576f8a28cf729c4bf4c33ccf12c58c6bd 100644 (file)
@@ -155,6 +155,8 @@ DolphinViewContainer::DolphinViewContainer(DolphinMainWindow* mainWindow,
 
     connect(m_urlNavigator, SIGNAL(urlChanged(const KUrl&)),
             this, SLOT(restoreView(const KUrl&)));
+    connect(m_urlNavigator, SIGNAL(historyChanged()),
+            this, SLOT(slotHistoryChanged()));
 
     m_statusBar = new DolphinStatusBar(this, m_view);
 
@@ -186,8 +188,8 @@ DolphinViewContainer::~DolphinViewContainer()
 
 void DolphinViewContainer::setUrl(const KUrl& newUrl)
 {
-    m_urlNavigator->setUrl(newUrl);
     if (newUrl != m_urlNavigator->url()) {
+        m_urlNavigator->setUrl(newUrl);
         // Temporary disable the 'File'->'Create New...' menu until
         // the write permissions can be checked in a fast way at
         // DolphinViewContainer::slotDirListerCompleted().
@@ -452,6 +454,17 @@ void DolphinViewContainer::saveUrlCompletionMode(KGlobalSettings::Completion com
     settings.save();
 }
 
+void DolphinViewContainer::slotHistoryChanged()
+{
+    const int index = m_urlNavigator->historyIndex();
+    if (index > 0) {
+        // The "Go Forward" action is enabled. Try to mark
+        // the previous directory as active item:
+        const KUrl url = m_urlNavigator->historyUrl(index - 1);
+        m_view->activateItem(url);
+    }
+}
+
 void DolphinViewContainer::slotItemTriggered(const KFileItem& item)
 {
     KUrl url = item.targetUrl();