X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/blobdiff_plain/aaaaea8e28f8ec99605de0af7118c67d5a30c772..30bf49d5d1539e9d02944230cf4489ebbccf5a45:/src/dolphinviewcontainer.cpp diff --git a/src/dolphinviewcontainer.cpp b/src/dolphinviewcontainer.cpp index f747d442e..5978ae938 100644 --- a/src/dolphinviewcontainer.cpp +++ b/src/dolphinviewcontainer.cpp @@ -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 @@ -425,6 +428,15 @@ QString DolphinViewContainer::caption() const if (!matchedPlaces.isEmpty()) { return placesModel->text(matchedPlaces.first()); } + + if (isSearchModeEnabled()) { + if (currentSearchText().isEmpty()){ + return i18n("Search"); + } else { + return i18n("Search for %1", currentSearchText()); + } + } + if (!url().isLocalFile()) { QUrl adjustedUrl = url().adjusted(QUrl::StripTrailingSlash); QString caption; @@ -445,14 +457,6 @@ QString DolphinViewContainer::caption() const fileName = '/'; } - if (isSearchModeEnabled()) { - if(currentSearchText().isEmpty()){ - return i18n("Search"); - } else { - return i18n("Search for %1", currentSearchText()); - } - } - return fileName; }