]> cloud.milkyroute.net Git - dolphin.git/commitdiff
DolphinViewContainer: set searchPath on redirect, check for connected urlNavigator
authorAkseli Lahtinen <akselmo@akselmo.dev>
Wed, 27 Nov 2024 10:00:02 +0000 (10:00 +0000)
committerAkseli Lahtinen <akselmo@akselmo.dev>
Wed, 27 Nov 2024 10:00:02 +0000 (10:00 +0000)
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

index 5494d7c41006cca93a9cb7e011e93674fc89a181..33f261bf4a1f1cfb2d9672f7df79b900305a0262 100644 (file)
@@ -497,7 +497,9 @@ void DolphinViewContainer::setSearchModeEnabled(bool enabled)
         if (url.isEmpty() || !url.isValid() || isSearchUrl(url)) {
             url = Dolphin::homeUrl();
         }
         if (url.isEmpty() || !url.isValid() || isSearchUrl(url)) {
             url = Dolphin::homeUrl();
         }
-        m_urlNavigatorConnected->setLocationUrl(url);
+        if (m_urlNavigatorConnected) {
+            m_urlNavigatorConnected->setLocationUrl(url);
+        }
     }
 
     m_searchModeEnabled = enabled;
     }
 
     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);
     // URL history.
     m_urlNavigator->saveLocationState(QByteArray());
     m_urlNavigator->setLocationUrl(newUrl);
+    m_searchBox->setSearchPath(newUrl);
     setSearchModeEnabled(isSearchUrl(newUrl));
 
     m_urlNavigator->blockSignals(block);
     setSearchModeEnabled(isSearchUrl(newUrl));
 
     m_urlNavigator->blockSignals(block);