]> cloud.milkyroute.net Git - dolphin.git/commitdiff
Fix primary view changing folder for the closing animation
authorFelix Ernst <fe.a.ernst@gmail.com>
Mon, 17 May 2021 12:52:45 +0000 (14:52 +0200)
committerFelix Ernst <fe.a.ernst@gmail.com>
Mon, 17 May 2021 12:52:45 +0000 (14:52 +0200)
This commit fixes a bug which made it so an UrlNavigator that was
disconnected from a viewContainer would still indirectly control
the viewContainer because of a dubious connection created in
DolphinMainWindow.

Instead the internal UrlNavigator of the viewContainer is used
which is always connected to its own viewContainer.

This way the the supposedly disconnected primary UrlNavigator will
actually not affect the old disconnected viewContainer that is
currently being closed.

BUG: 437080
FIXED-IN: 21.08

src/dolphinmainwindow.cpp
src/dolphinmainwindow.h

index 87deb8ca610850050f726c68c18bb3d0e2188e87..c2c4ae703fb69dad2a90d1ac54355009a2d5fc74 100644 (file)
@@ -1274,6 +1274,7 @@ void DolphinMainWindow::activeViewChanged(DolphinViewContainer* viewContainer)
         // view and url navigator) and main window.
         oldViewContainer->disconnect(this);
         oldViewContainer->view()->disconnect(this);
+        oldViewContainer->urlNavigatorInternalWithHistory()->disconnect(this);
         auto navigators = static_cast<DolphinNavigatorsWidgetAction *>
                           (actionCollection()->action(QStringLiteral("url_navigators")));
         navigators->primaryUrlNavigator()->disconnect(this);
@@ -2144,15 +2145,17 @@ void DolphinMainWindow::connectViewSignals(DolphinViewContainer* container)
     connect(view, &DolphinView::goUpRequested,
             this, &DolphinMainWindow::goUp);
 
+    connect(container->urlNavigatorInternalWithHistory(), &KUrlNavigator::urlChanged,
+            this, &DolphinMainWindow::changeUrl);
+    connect(container->urlNavigatorInternalWithHistory(), &KUrlNavigator::historyChanged,
+            this, &DolphinMainWindow::updateHistory);
+
     auto navigators = static_cast<DolphinNavigatorsWidgetAction *>
         (actionCollection()->action(QStringLiteral("url_navigators")));
-
     const KUrlNavigator *navigator = m_tabWidget->currentTabPage()->primaryViewActive() ?
                                      navigators->primaryUrlNavigator() :
                                      navigators->secondaryUrlNavigator();
 
-    connect(navigator, &KUrlNavigator::urlChanged,
-            this, &DolphinMainWindow::changeUrl);
     QAction *editableLocactionAction = actionCollection()->action(QStringLiteral("editable_location"));
     editableLocactionAction->setChecked(navigator->isUrlEditable());
     connect(navigator, &KUrlNavigator::editableStateChanged,
@@ -2160,10 +2163,6 @@ void DolphinMainWindow::connectViewSignals(DolphinViewContainer* container)
     connect(navigator, &KUrlNavigator::tabRequested,
             this, &DolphinMainWindow::openNewTab);
 
-    disconnect(m_updateHistoryConnection);
-    m_updateHistoryConnection = connect(
-            container->urlNavigatorInternalWithHistory(), &KUrlNavigator::historyChanged,
-            this, &DolphinMainWindow::updateHistory);
 }
 
 void DolphinMainWindow::updateSplitAction()
index 2b8165ea418c2cfc52e26e681827157d5d87595a..95e8bb5644237ced186c825b2f8514b8cb81d93a 100644 (file)
@@ -671,9 +671,6 @@ private:
     KToolBarPopupAction* m_backAction;
     KToolBarPopupAction* m_forwardAction;
 
-    /** Makes sure that only one object is ever connected to the history. */
-    QMetaObject::Connection m_updateHistoryConnection;
-
     QMenu m_searchTools;
 };