X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/blobdiff_plain/ada16756d69c012c089733f6ce4e9271f84ccca6..8599a42ac13e2af6f085d899380aee7714ae28c2:/src/dolphinviewcontainer.cpp diff --git a/src/dolphinviewcontainer.cpp b/src/dolphinviewcontainer.cpp index 585610550..c6d9d89ad 100644 --- a/src/dolphinviewcontainer.cpp +++ b/src/dolphinviewcontainer.cpp @@ -385,6 +385,11 @@ bool DolphinViewContainer::isFilterBarVisible() const void DolphinViewContainer::setSearchModeEnabled(bool enabled) { + if (enabled) { + const QUrl& locationUrl = m_urlNavigator->locationUrl(); + m_searchBox->fromSearchUrl(locationUrl); + } + if (enabled == isSearchModeEnabled()) { if (enabled && !m_searchBox->hasFocus()) { m_searchBox->setFocus(); @@ -396,10 +401,7 @@ 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); - } else { + if (!enabled) { m_view->setViewPropertiesContext(QString()); // Restore the URL for the URL navigator. If Dolphin has been @@ -426,7 +428,7 @@ QString DolphinViewContainer::placesText() const if (isSearchModeEnabled()) { text = i18n("Search for %1 in %2", m_searchBox->text(), m_searchBox->searchPath().fileName()); } else { - text = url().fileName(); + text = url().adjusted(QUrl::StripTrailingSlash).fileName(); if (text.isEmpty()) { text = url().host(); }