Fix crash when lauching dolphin with a search scheme

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
This commit is contained in:
Ismael Asensio 2019-10-06 11:34:30 +02:00 committed by Elvis Angelaccio
parent d9d3b142b7
commit 31fd775f36

View file

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