]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/dolphinview.cpp
hide the ratings and tags column in the treeview sidebar
[dolphin.git] / src / dolphinview.cpp
index 0b6c32811dec3117bf48a21f312961850b6a8987..91a41b531b664e53c74878c774da1441bf60cdc6 100644 (file)
@@ -408,18 +408,37 @@ void DolphinView::refresh()
     updateViewportColor();
 }
 
-void DolphinView::setUrl(const KUrl& url)
+void DolphinView::updateView(const KUrl& url, const KUrl& rootUrl)
 {
     if (m_controller->url() == url) {
         return;
     }
 
+    const bool restoreColumnView = !isColumnViewActive()
+                                    && !rootUrl.isEmpty()
+                                    && !rootUrl.equals(url, KUrl::CompareWithoutTrailingSlash)
+                                    && rootUrl.isParentOf(url);
+
     m_controller->setUrl(url); // emits urlChanged, which we forward
 
-    applyViewProperties(url);
+    if (restoreColumnView) {
+        applyViewProperties(rootUrl);
+        Q_ASSERT(itemView() == m_columnView);
+        startDirLister(rootUrl);
+        m_columnView->showColumn(url);
+    } else {
+        applyViewProperties(url);
+        startDirLister(url);
+    }
 
-    startDirLister(url);
     itemView()->setFocus();
+
+    emit startedPathLoading(url);
+}
+
+void DolphinView::setUrl(const KUrl& url)
+{
+    updateView(url, KUrl());
 }
 
 void DolphinView::mouseReleaseEvent(QMouseEvent* event)