From ed5b2e54736b04d551eae01d976038fb7d5aac35 Mon Sep 17 00:00:00 2001 From: Peter Penz Date: Tue, 20 May 2008 21:21:48 +0000 Subject: when going back in history apply the keyboard focus to the the previously shown directory BUG: 156550 BUG: 158590 svn path=/trunk/KDE/kdebase/apps/; revision=810493 --- src/dolphinview.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src/dolphinview.cpp') diff --git a/src/dolphinview.cpp b/src/dolphinview.cpp index 2618dea27..f0a4487c9 100644 --- a/src/dolphinview.cpp +++ b/src/dolphinview.cpp @@ -347,6 +347,20 @@ QPoint DolphinView::contentsPosition() const return QPoint(x, y); } +void DolphinView::setCurrentItem(const KUrl& url) +{ + const QModelIndex dirIndex = m_dolphinModel->indexForUrl(url); + if (dirIndex.isValid()) { + const QModelIndex proxyIndex = m_proxyModel->mapFromSource(dirIndex); + QAbstractItemView* view = itemView(); + const bool clearSelection = !hasSelection(); + view->setCurrentIndex(proxyIndex); + if (clearSelection) { + view->clearSelection(); + } + } +} + void DolphinView::zoomIn() { m_controller->triggerZoomIn(); -- cgit v1.3