]> cloud.milkyroute.net Git - dolphin.git/commitdiff
Fix crash when lauching dolphin with a search scheme
authorIsmael Asensio <isma.af@mgmail.com>
Sun, 6 Oct 2019 09:34:30 +0000 (11:34 +0200)
committerElvis Angelaccio <elvis.angelaccio@kde.org>
Sun, 6 Oct 2019 09:34:30 +0000 (11:34 +0200)
Summary: Widget objects are initialized in `DolphinSearchBox::init()`, which is called on `QEvent::Polish`, so we must set it visible before calling `fromSearchUrl`.

Test Plan: `dolphin --new-window baloosearch://`

Reviewers: #dolphin, elvisangelaccio

Subscribers: kfm-devel

Tags: #dolphin

Differential Revision: https://phabricator.kde.org/D24432

src/dolphinviewcontainer.cpp

index c6d9d89ad9fffb50218c105155dfb78a5ee816e8..536ab0fa80b4af0614e9cb9296cc9d2cab8b0595 100644 (file)
@@ -385,6 +385,9 @@ bool DolphinViewContainer::isFilterBarVisible() const
 
 void DolphinViewContainer::setSearchModeEnabled(bool enabled)
 {
+    m_searchBox->setVisible(enabled);
+    m_navigatorWidget->setVisible(!enabled);
+
     if (enabled) {
         const QUrl& locationUrl = m_urlNavigator->locationUrl();
         m_searchBox->fromSearchUrl(locationUrl);
@@ -398,9 +401,6 @@ void DolphinViewContainer::setSearchModeEnabled(bool enabled)
         return;
     }
 
-    m_searchBox->setVisible(enabled);
-    m_navigatorWidget->setVisible(!enabled);
-
     if (!enabled) {
         m_view->setViewPropertiesContext(QString());