PlacesPanel: activating a place does not select its previously selected children

BUG: 421347
This commit is contained in:
Méven Car 2020-11-08 08:21:56 +01:00
parent 2084814781
commit 4f4e3d392c
3 changed files with 23 additions and 0 deletions

View 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();
}
}

View 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)

View 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