┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src/dolphinviewcontainer.cpp
diff options
context:
space:
mode:
authorFrank Reininghaus <[email protected]>2009-11-14 15:51:47 +0000
committerFrank Reininghaus <[email protected]>2009-11-14 15:51:47 +0000
commit487215f0c459ca38c68619325edac4a2fe42ca4b (patch)
tree15ab897d8696f0093dbe93319cb434a6fa20088c /src/dolphinviewcontainer.cpp
parentd49bdf8f9c7b8b2445e4355c955763ddf6339c19 (diff)
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
Diffstat (limited to 'src/dolphinviewcontainer.cpp')
-rw-r--r--src/dolphinviewcontainer.cpp13
1 files changed, 4 insertions, 9 deletions
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);
}
}