]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/dolphinviewcontainer.cpp
Move from the searchbox to the results with the down arrow key
[dolphin.git] / src / dolphinviewcontainer.cpp
index bd3c8ed20f1d18f05ab15a61e8f86b2038f700b8..60d3374ad46cce67469ab5844aba3bb642cdd402 100644 (file)
@@ -119,7 +119,7 @@ DolphinViewContainer::DolphinViewContainer(const QUrl& url, QWidget* parent) :
     connect(m_searchBox, &DolphinSearchBox::activated, this, &DolphinViewContainer::activate);
     connect(m_searchBox, &DolphinSearchBox::closeRequest, this, &DolphinViewContainer::closeSearchBox);
     connect(m_searchBox, &DolphinSearchBox::searchRequest, this, &DolphinViewContainer::startSearching);
-    connect(m_searchBox, &DolphinSearchBox::returnPressed, this, &DolphinViewContainer::requestFocus);
+    connect(m_searchBox, &DolphinSearchBox::focusViewRequest, this, &DolphinViewContainer::requestFocus);
     m_searchBox->setWhatsThis(xi18nc("@info:whatsthis findbar",
         "<para>This helps you find files and folders. Enter a <emphasis>"
         "search term</emphasis> and specify search settings with the "
@@ -449,22 +449,20 @@ void DolphinViewContainer::reload()
     m_messageWidget->hide();
 }
 
-QString DolphinViewContainer::caption() const
+QString DolphinViewContainer::captionWindowTitle() const
 {
-    if (GeneralSettings::showFullPathInTitlebar()) {
+    if (GeneralSettings::showFullPathInTitlebar() && !isSearchModeEnabled()) {
         if (!url().isLocalFile()) {
             return url().adjusted(QUrl::StripTrailingSlash).toString();
         }
         return url().adjusted(QUrl::StripTrailingSlash).path();
+    } else {
+        return DolphinViewContainer::caption();
     }
+}
 
-    KFilePlacesModel *placesModel = DolphinPlacesModelSingleton::instance().placesModel();
-    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());
-    }
-
+QString DolphinViewContainer::caption() const
+{
     if (isSearchModeEnabled()) {
         if (currentSearchText().isEmpty()){
             return i18n("Search");
@@ -473,6 +471,14 @@ QString DolphinViewContainer::caption() const
         }
     }
 
+    KFilePlacesModel *placesModel = DolphinPlacesModelSingleton::instance().placesModel();
+    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());
+    }
+
+
     if (!url().isLocalFile()) {
         QUrl adjustedUrl = url().adjusted(QUrl::StripTrailingSlash);
         QString caption;