From 17ff26c355adf945e143418c8bd756cf168d963b Mon Sep 17 00:00:00 2001 From: Frank Reininghaus Date: Tue, 26 Jan 2010 12:18:08 +0000 Subject: Reorganise some code in DolphinView and DolphinViewContainer. This makes it possible to restore the expanded folders in the Details View when navigating in history (based on r1056438 and r1079843). Also remove DolphinView::activateItem(const KUrl&) and DolphinView's m_loadingDirectory member (they are not needed any more). This will be in KDE 4.5. BUG: 169886 svn path=/trunk/KDE/kdebase/apps/; revision=1080549 --- src/dolphinviewcontainer.cpp | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-) (limited to 'src/dolphinviewcontainer.cpp') diff --git a/src/dolphinviewcontainer.cpp b/src/dolphinviewcontainer.cpp index 8f4427cb9..89cf6cdbd 100644 --- a/src/dolphinviewcontainer.cpp +++ b/src/dolphinviewcontainer.cpp @@ -307,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. @@ -369,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); @@ -458,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); } } -- cgit v1.3