diff options
| author | Akseli Lahtinen <[email protected]> | 2024-11-27 10:00:02 +0000 |
|---|---|---|
| committer | Akseli Lahtinen <[email protected]> | 2024-11-27 10:00:02 +0000 |
| commit | c4ecf1cb2bf199ddccd02990429b535385475ffc (patch) | |
| tree | 1fb53c1d80e77245290b61baa9fe553ec304f3c1 | |
| parent | b61721e2acff4081f2fc3402b8eeacf32acbb5f7 (diff) | |
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
| -rw-r--r-- | src/dolphinviewcontainer.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
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); |
