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()
}
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)
*/
void updateItemCount();
+ /**
+ * Restores the x- and y-position of the contents if the
+ * current view is part of the history.
+ */
+ void restoreContentsPos();
+
/** Shows the information \a msg inside the statusbar. */
void showInfoMessage(const QString& msg);