Track search mode in variable

Rather than relying on a widget being visible which might not be the case for e.g. non-active tabs

Differential Revision: https://phabricator.kde.org/D15774
This commit is contained in:
Kai Uwe Broulik 2018-09-27 12:57:18 +02:00
parent 0483b8a77f
commit be077d3a0c
2 changed files with 5 additions and 1 deletions

View file

@ -56,6 +56,7 @@ DolphinViewContainer::DolphinViewContainer(const QUrl& url, QWidget* parent) :
m_urlNavigator(nullptr),
m_emptyTrashButton(nullptr),
m_searchBox(nullptr),
m_searchModeEnabled(false),
m_messageWidget(nullptr),
m_view(nullptr),
m_filterBar(nullptr),
@ -378,11 +379,13 @@ void DolphinViewContainer::setSearchModeEnabled(bool enabled)
}
m_urlNavigator->setLocationUrl(url);
}
m_searchModeEnabled = enabled;
}
bool DolphinViewContainer::isSearchModeEnabled() const
{
return m_searchBox->isVisible();
return m_searchModeEnabled;
}
QString DolphinViewContainer::placesText() const

View file

@ -331,6 +331,7 @@ private:
KUrlNavigator* m_urlNavigator;
QPushButton* m_emptyTrashButton;
DolphinSearchBox* m_searchBox;
bool m_searchModeEnabled;
KMessageWidget* m_messageWidget;
DolphinView* m_view;