From c4ecf1cb2bf199ddccd02990429b535385475ffc Mon Sep 17 00:00:00 2001 From: Akseli Lahtinen Date: Wed, 27 Nov 2024 10:00:02 +0000 Subject: [PATCH] DolphinViewContainer: set searchPath on redirect, check for connected urlNavigator This fixes a dolphin crash if tab with a search box open gets its path changed while its not active. This patch adds a guard for the m_urlNavigatorConnected->setLocation, and makes sure the searchPath is set to the correct folder. BUG:496387 --- src/dolphinviewcontainer.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/dolphinviewcontainer.cpp b/src/dolphinviewcontainer.cpp index 5494d7c41..33f261bf4 100644 --- a/src/dolphinviewcontainer.cpp +++ b/src/dolphinviewcontainer.cpp @@ -497,7 +497,9 @@ void DolphinViewContainer::setSearchModeEnabled(bool enabled) if (url.isEmpty() || !url.isValid() || isSearchUrl(url)) { url = Dolphin::homeUrl(); } - m_urlNavigatorConnected->setLocationUrl(url); + if (m_urlNavigatorConnected) { + m_urlNavigatorConnected->setLocationUrl(url); + } } m_searchModeEnabled = enabled; @@ -894,6 +896,7 @@ void DolphinViewContainer::redirect(const QUrl &oldUrl, const QUrl &newUrl) // URL history. m_urlNavigator->saveLocationState(QByteArray()); m_urlNavigator->setLocationUrl(newUrl); + m_searchBox->setSearchPath(newUrl); setSearchModeEnabled(isSearchUrl(newUrl)); m_urlNavigator->blockSignals(block); -- 2.47.3