From 85bc196887fbed01187e3830cd28c2500cb01cb2 Mon Sep 17 00:00:00 2001 From: David Faure Date: Mon, 26 Mar 2007 23:04:43 +0000 Subject: Ported to KBookmarkManager::closestBookmark - which even solves another TODO about code duplication. Improved urlnavigator API to avoid exposing the full QList (api independent from implementation now). svn path=/trunk/KDE/kdebase/apps/; revision=646954 --- src/dolphinview.cpp | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) (limited to 'src/dolphinview.cpp') diff --git a/src/dolphinview.cpp b/src/dolphinview.cpp index 23c91b9f4..17bbd608d 100644 --- a/src/dolphinview.cpp +++ b/src/dolphinview.cpp @@ -454,11 +454,6 @@ void DolphinView::setUrlEditable(bool editable) m_urlNavigator->editUrl(editable); } -const QList DolphinView::urlHistory(int& index) const -{ - return m_urlNavigator->history(index); -} - bool DolphinView::hasSelection() const { return itemView()->selectionModel()->hasSelection(); @@ -771,15 +766,12 @@ void DolphinView::showPreview(const KFileItem* item, const QPixmap& pixmap) void DolphinView::restoreContentsPos() { - int index = 0; - const QList history = urlHistory(index); - if (!history.isEmpty()) { + UrlNavigator::HistoryElem historyItem = m_urlNavigator->currentHistoryItem(); + if (!historyItem.url().isEmpty()) { QAbstractItemView* view = itemView(); - // TODO: view->setCurrentItem(history[index].currentFileName()); - - const UrlNavigator::HistoryElem& it = history[index]; - view->horizontalScrollBar()->setValue(it.contentsX()); - view->verticalScrollBar()->setValue(it.contentsY()); + // TODO: view->setCurrentItem(historyItem.currentFileName()); + view->horizontalScrollBar()->setValue(historyItem.contentsX()); + view->verticalScrollBar()->setValue(historyItem.contentsY()); } } -- cgit v1.3