]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/dolphinviewcontainer.cpp
Request the activation of the view, even if the column is marked as active already...
[dolphin.git] / src / dolphinviewcontainer.cpp
index 53b1c75293d05b103eef6d7787261cc4d1fc64b0..89cf6cdbd0a7eda65c54e99a1cdf59b121e67c9b 100644 (file)
@@ -85,8 +85,6 @@ DolphinViewContainer::DolphinViewContainer(const KUrl& url, QWidget* parent) :
             this, SLOT(dropUrls(const KUrl&, QDropEvent*)));
     connect(m_urlNavigator, SIGNAL(activated()),
             this, SLOT(activate()));
-    //connect(m_urlNavigator, SIGNAL(tabRequested(const KUrl&)),
-    //        this,
     connect(m_urlNavigator->editor(), SIGNAL(completionModeChanged(KGlobalSettings::Completion)),
             this, SLOT(saveUrlCompletionMode(KGlobalSettings::Completion)));
 
@@ -309,7 +307,6 @@ void DolphinViewContainer::slotDirListerCompleted()
     } else {
         updateStatusBar();
     }
-    QMetaObject::invokeMethod(this, "restoreViewState", Qt::QueuedConnection);
 
     // Enable the 'File'->'Create New...' menu only if the directory
     // supports writing.
@@ -371,13 +368,6 @@ void DolphinViewContainer::setNameFilter(const QString& nameFilter)
     delayedStatusBarUpdate();
 }
 
-void DolphinViewContainer::restoreViewState()
-{
-    QByteArray locationState = m_urlNavigator->locationState();
-    QDataStream stream(&locationState, QIODevice::ReadOnly);
-    m_view->restoreState(stream);
-}
-
 void DolphinViewContainer::activate()
 {
     setActive(true);
@@ -460,12 +450,11 @@ void DolphinViewContainer::saveUrlCompletionMode(KGlobalSettings::Completion com
 
 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->locationUrl(index - 1);
-        m_view->activateItem(url);
+    QByteArray locationState = m_urlNavigator->locationState();
+
+    if (!locationState.isEmpty()) {
+        QDataStream stream(&locationState, QIODevice::ReadOnly);
+        m_view->restoreState(stream);
     }
 }