┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src/dolphinview.cpp
diff options
context:
space:
mode:
authorPeter Penz <[email protected]>2007-02-10 21:29:29 +0000
committerPeter Penz <[email protected]>2007-02-10 21:29:29 +0000
commit64ef4394f97af721d364390ba00338b3a4006488 (patch)
tree39dd812434939fdee00d89054cec6a8dd843463d /src/dolphinview.cpp
parentfcf8436737384a1b4483ff927faf041ba01213ea (diff)
restore the x- and y-position of the view if the current view is part of the history
svn path=/trunk/playground/utils/dolphin/; revision=632370
Diffstat (limited to 'src/dolphinview.cpp')
-rw-r--r--src/dolphinview.cpp21
1 files changed, 19 insertions, 2 deletions
diff --git a/src/dolphinview.cpp b/src/dolphinview.cpp
index 9b2286c87..2b4546751 100644
--- a/src/dolphinview.cpp
+++ b/src/dolphinview.cpp
@@ -319,12 +319,12 @@ DolphinStatusBar* DolphinView::statusBar() const
int DolphinView::contentsX() const
{
- return 0; //scrollView()->contentsX();
+ return itemView()->horizontalScrollBar()->value();
}
int DolphinView::contentsY() const
{
- return 0; //scrollView()->contentsY();
+ return itemView()->verticalScrollBar()->value();
}
void DolphinView::refreshSettings()
@@ -668,6 +668,23 @@ void DolphinView::updateItemCount()
}
updateStatusBar();
+
+ QTimer::singleShot(0, this, SLOT(restoreContentsPos()));
+}
+
+void DolphinView::restoreContentsPos()
+{
+ int index = 0;
+ const QLinkedList<UrlNavigator::HistoryElem> history = urlHistory(index);
+ if (!history.isEmpty()) {
+ QAbstractItemView* view = itemView();
+ // TODO: view->setCurrentItem(history[index].currentFileName());
+
+ QLinkedList<UrlNavigator::HistoryElem>::const_iterator it = history.begin();
+ it += index;
+ view->horizontalScrollBar()->setValue((*it).contentsX());
+ view->verticalScrollBar()->setValue((*it).contentsY());
+ }
}
void DolphinView::showInfoMessage(const QString& msg)