From: Akseli Lahtinen Date: Wed, 27 Nov 2024 10:00:02 +0000 (+0000) Subject: DolphinViewContainer: set searchPath on redirect, check for connected urlNavigator X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/commitdiff_plain/c4ecf1cb2bf199ddccd02990429b535385475ffc?ds=inline 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 --- 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);