]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/dolphinview.cpp
people want tabs, give them tabs
[dolphin.git] / src / dolphinview.cpp
index 2618dea275d5d25bd7b91ef3932aa5e7337ec9a6..f0a4487c939d10e5ec9eb7e532e7a69b5e1e82a6 100644 (file)
@@ -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();