Commit 98e1fb66 authored by Felix Ernst's avatar Felix Ernst
Browse files

Fix primary view changing folder for the closing animation

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
parent 75d1d25d
Pipeline #62328 passed with stage
in 5 minutes and 8 seconds
......@@ -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()
......
......@@ -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;
};
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment