]> cloud.milkyroute.net Git - dolphin.git/commitdiff
Merge branch 'Applications/19.08'
authorElvis Angelaccio <elvis.angelaccio@kde.org>
Wed, 2 Oct 2019 21:03:27 +0000 (23:03 +0200)
committerElvis Angelaccio <elvis.angelaccio@kde.org>
Wed, 2 Oct 2019 21:03:27 +0000 (23:03 +0200)
1  2 
src/dolphinviewcontainer.cpp

index dcec1db09783e7cec88dc68469324f8d58bf5a41,8e821d8aae23ed497eba4bb88aad947ef9991c6c..98b812497986f472efb9360815633af928fa21a0
@@@ -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
      }
  
      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.
                  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()