]> cloud.milkyroute.net Git - dolphin.git/commitdiff
DolphinViewContainer: setSearchPath value only if searchBox is active
authorAkseli Lahtinen <akselmo@akselmo.dev>
Wed, 27 Nov 2024 10:28:13 +0000 (12:28 +0200)
committerAkseli Lahtinen <akselmo@akselmo.dev>
Wed, 27 Nov 2024 10:28:13 +0000 (12:28 +0200)
Fixes a crash when searchbox is not active and tab gets renamed.

I forgot to add this to merge request
https://invent.kde.org/system/dolphin/-/merge_requests/864

CCBUG:496387

src/dolphinviewcontainer.cpp

index 33f261bf4a1f1cfb2d9672f7df79b900305a0262..f2df638f6cbfb7a68ed09b151bceee41fb867dbc 100644 (file)
@@ -896,7 +896,9 @@ void DolphinViewContainer::redirect(const QUrl &oldUrl, const QUrl &newUrl)
     // URL history.
     m_urlNavigator->saveLocationState(QByteArray());
     m_urlNavigator->setLocationUrl(newUrl);
     // URL history.
     m_urlNavigator->saveLocationState(QByteArray());
     m_urlNavigator->setLocationUrl(newUrl);
-    m_searchBox->setSearchPath(newUrl);
+    if (m_searchBox->isActive()) {
+        m_searchBox->setSearchPath(newUrl);
+    }
     setSearchModeEnabled(isSearchUrl(newUrl));
 
     m_urlNavigator->blockSignals(block);
     setSearchModeEnabled(isSearchUrl(newUrl));
 
     m_urlNavigator->blockSignals(block);