]> cloud.milkyroute.net Git - dolphin.git/commitdiff
PlacesPanel: activating a place does not select its previously selected children
authorMéven Car <meven29@gmail.com>
Sun, 8 Nov 2020 07:21:56 +0000 (08:21 +0100)
committerMéven Car <meven29@gmail.com>
Sat, 17 Apr 2021 08:44:28 +0000 (10:44 +0200)
BUG: 421347

src/dolphinmainwindow.cpp
src/dolphinviewcontainer.cpp
src/dolphinviewcontainer.h

index e7c402b885cbbbdc9fb170fe916a28c91f2f5a2e..0ff7e77e55674ce6a57adfb9cfd2e2457f349907 100644 (file)
@@ -1243,7 +1243,9 @@ void DolphinMainWindow::slotPlaceActivated(const QUrl& url)
         // which had been unmounted earlier, see https://bugs.kde.org/show_bug.cgi?id=161385.
         reloadView();
     } else {
+        view->disableUrlNavigatorSelectionRequests();
         changeUrl(url);
+        view->enableUrlNavigatorSelectionRequests();
     }
 }
 
index 549b62b0393c62bb8ba84b0d6bcb063e922339d0..1a608669f6f0eca23dfe902538d6d4cbf39a18e4 100644 (file)
@@ -727,6 +727,18 @@ void DolphinViewContainer::slotUrlSelectionRequested(const QUrl& url)
     m_view->markUrlAsCurrent(url); // makes the item scroll into view
 }
 
+void DolphinViewContainer::disableUrlNavigatorSelectionRequests()
+{
+    disconnect(m_urlNavigator.get(), &KUrlNavigator::urlSelectionRequested,
+        this, &DolphinViewContainer::slotUrlSelectionRequested);
+}
+
+void DolphinViewContainer::enableUrlNavigatorSelectionRequests()
+{
+    connect(m_urlNavigator.get(), &KUrlNavigator::urlSelectionRequested,
+        this, &DolphinViewContainer::slotUrlSelectionRequested);
+}
+
 void DolphinViewContainer::redirect(const QUrl& oldUrl, const QUrl& newUrl)
 {
     Q_UNUSED(oldUrl)
index 40e4978d9cc50cef528b67de06583c4dbb5904c9..1a92e1fa6d266dd846941fa1b587c83257aedf8e 100644 (file)
@@ -174,6 +174,15 @@ public:
      */
     QString caption() const;
 
+    /**
+     * Disable/enable the behavior of "select child when moving to parent folder"
+     * offered by KUrlNavigator.
+     *
+     * See KUrlNavigator::urlSelectionRequested
+     */
+    void disableUrlNavigatorSelectionRequests();
+    void enableUrlNavigatorSelectionRequests();
+
 public Q_SLOTS:
     /**
      * Sets the current active URL, where all actions are applied. The