From: Elvis Angelaccio Date: Wed, 2 Oct 2019 21:03:27 +0000 (+0200) Subject: Merge branch 'Applications/19.08' X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/commitdiff_plain/43ea7052e15b1cb917bcc6cd2bd3a8046179e45c?hp=-c Merge branch 'Applications/19.08' --- 43ea7052e15b1cb917bcc6cd2bd3a8046179e45c diff --combined src/dolphinviewcontainer.cpp index dcec1db09,8e821d8aa..98b812497 --- a/src/dolphinviewcontainer.cpp +++ b/src/dolphinviewcontainer.cpp @@@ -396,10 -396,7 +396,7 @@@ void DolphinViewContainer::setSearchMod 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 @@@ -412,8 -409,6 +409,8 @@@ } m_searchModeEnabled = enabled; + + emit searchModeEnabledChanged(enabled); } bool DolphinViewContainer::isSearchModeEnabled() const @@@ -456,7 -451,7 +453,7 @@@ QString DolphinViewContainer::caption( } KFilePlacesModel *placesModel = DolphinPlacesModelSingleton::instance().placesModel(); - const auto& matchedPlaces = placesModel->match(placesModel->index(0,0), KFilePlacesModel::UrlRole, url(), 1, Qt::MatchExactly); + const auto& matchedPlaces = placesModel->match(placesModel->index(0,0), KFilePlacesModel::UrlRole, QUrl(url().adjusted(QUrl::StripTrailingSlash).toString(QUrl::FullyEncoded).append("/?")), 1, Qt::MatchRegExp); if (!matchedPlaces.isEmpty()) { return placesModel->text(matchedPlaces.first()); @@@ -676,11 -671,15 +673,15 @@@ void DolphinViewContainer::slotUrlNavig 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. @@@ -699,7 -698,7 +700,7 @@@ app = browser; if (app.startsWith('!')) { // a literal command has been configured, remove the '!' prefix - app = app.mid(1); + app.remove(0, 1); } } } else { @@@ -787,7 -786,7 +788,7 @@@ void DolphinViewContainer::showErrorMes bool DolphinViewContainer::isSearchUrl(const QUrl& url) const { - return url.scheme().contains(QStringLiteral("search")); + return url.scheme().contains(QLatin1String("search")); } void DolphinViewContainer::saveViewState()