From 487215f0c459ca38c68619325edac4a2fe42ca4b Mon Sep 17 00:00:00 2001 From: Frank Reininghaus Date: Sat, 14 Nov 2009 15:51:47 +0000 Subject: When navigating back/forward in the DolphinPart inside Konqueror, remember 1. the current item, 2. the scroll position of the view, and 3. the expansion state of the details view. Before 3. can be implemented in Dolphin itself, some changes in KUrlNavigator are required. This fix will be in KDE 4.4. BUG: 193549 BUG: 198073 BUG: 213137 svn path=/trunk/KDE/kdebase/apps/; revision=1049164 --- src/dolphinviewcontainer.cpp | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) (limited to 'src/dolphinviewcontainer.cpp') diff --git a/src/dolphinviewcontainer.cpp b/src/dolphinviewcontainer.cpp index 5639d9bf2..ece22f4c0 100644 --- a/src/dolphinviewcontainer.cpp +++ b/src/dolphinviewcontainer.cpp @@ -314,7 +314,6 @@ void DolphinViewContainer::slotDirListerCompleted() } else { updateStatusBar(); } - QMetaObject::invokeMethod(this, "restoreContentsPos", Qt::QueuedConnection); // Enable the 'File'->'Create New...' menu only if the directory // supports writing. @@ -387,17 +386,11 @@ void DolphinViewContainer::openContextMenu(const KFileItem& item, void DolphinViewContainer::saveContentsPos(int x, int y) { + // TODO: If DolphinViewContainer uses DolphinView::saveState(...) to save the + // view state in KDE 4.5, this funciton can be removed. m_urlNavigator->savePosition(x, y); } -void DolphinViewContainer::restoreContentsPos() -{ - if (!url().isEmpty()) { - const QPoint pos = m_urlNavigator->savedPosition(); - m_view->setContentsPosition(pos.x(), pos.y()); - } -} - void DolphinViewContainer::activate() { setActive(true); @@ -484,6 +477,8 @@ void DolphinViewContainer::slotHistoryChanged() // the previous directory as active item: const KUrl url = m_urlNavigator->historyUrl(index - 1); m_view->activateItem(url); + QPoint pos = m_urlNavigator->savedPosition(); + m_view->setRestoredContentsPosition(pos); } } -- cgit v1.3