From a38f83014467f61059fc40b2273d0175e9b3b26d Mon Sep 17 00:00:00 2001 From: Peter Penz Date: Mon, 8 Jun 2009 05:55:46 +0000 Subject: Mark the last visitied directory as active when going back in history. BUG: 192811 svn path=/trunk/KDE/kdebase/apps/; revision=978757 --- src/dolphinviewcontainer.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'src/dolphinviewcontainer.cpp') diff --git a/src/dolphinviewcontainer.cpp b/src/dolphinviewcontainer.cpp index 9f61360d7..cffffd70b 100644 --- a/src/dolphinviewcontainer.cpp +++ b/src/dolphinviewcontainer.cpp @@ -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); @@ -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(); -- cgit v1.3