X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/blobdiff_plain/ada16756d69c012c089733f6ce4e9271f84ccca6..b3120cb90e3d1dd5f4eef13e93378ccb1d01d098:/src/dolphinviewcontainer.cpp diff --git a/src/dolphinviewcontainer.cpp b/src/dolphinviewcontainer.cpp index 585610550..8e821d8aa 100644 --- a/src/dolphinviewcontainer.cpp +++ b/src/dolphinviewcontainer.cpp @@ -396,10 +396,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 +423,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(); } @@ -674,11 +671,15 @@ void DolphinViewContainer::slotUrlNavigatorLocationChanged(const QUrl& url) slotReturnPressed(); if (KProtocolManager::supportsListing(url)) { - setSearchModeEnabled(isSearchUrl(url)); + const bool searchUrl = isSearchUrl(url); + if (searchUrl) { + m_searchBox->fromSearchUrl(url); + } + setSearchModeEnabled(searchUrl); m_view->setUrl(url); tryRestoreViewState(); - if (m_autoGrabFocus && isActive() && !isSearchUrl(url)) { + if (m_autoGrabFocus && isActive() && !searchUrl) { // When an URL has been entered, the view should get the focus. // The focus must be requested asynchronously, as changing the URL might create // a new view widget.