]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/dolphinviewcontainer.cpp
Fix minor typos
[dolphin.git] / src / dolphinviewcontainer.cpp
index fc3090183bf14076c8b2ad7097857a9c7c894b4e..767af64e1c6b103236c15cc517f8653e939ee8f2 100644 (file)
@@ -56,6 +56,7 @@ DolphinViewContainer::DolphinViewContainer(const QUrl& url, QWidget* parent) :
     m_urlNavigator(nullptr),
     m_emptyTrashButton(nullptr),
     m_searchBox(nullptr),
+    m_searchModeEnabled(false),
     m_messageWidget(nullptr),
     m_view(nullptr),
     m_filterBar(nullptr),
@@ -378,11 +379,13 @@ void DolphinViewContainer::setSearchModeEnabled(bool enabled)
         }
         m_urlNavigator->setLocationUrl(url);
     }
+
+    m_searchModeEnabled = enabled;
 }
 
 bool DolphinViewContainer::isSearchModeEnabled() const
 {
-    return m_searchBox->isVisible();
+    return m_searchModeEnabled;
 }
 
 QString DolphinViewContainer::placesText() const
@@ -410,7 +413,7 @@ void DolphinViewContainer::reload()
     m_messageWidget->hide();
 }
 
-QString DolphinViewContainer::getCaption() const
+QString DolphinViewContainer::caption() const
 {
     if (GeneralSettings::showFullPathInTitlebar()) {
         if (!url().isLocalFile()) {
@@ -425,6 +428,15 @@ QString DolphinViewContainer::getCaption() const
     if (!matchedPlaces.isEmpty()) {
         return placesModel->text(matchedPlaces.first());
     }
+
+    if (isSearchModeEnabled()) {
+        if (currentSearchText().isEmpty()){
+            return i18n("Search");
+        } else {
+            return i18n("Search for %1", currentSearchText());
+        }
+    }
+
     if (!url().isLocalFile()) {
         QUrl adjustedUrl = url().adjusted(QUrl::StripTrailingSlash);
         QString caption;
@@ -445,14 +457,6 @@ QString DolphinViewContainer::getCaption() const
         fileName = '/';
     }
 
-    if (isSearchModeEnabled()) {
-        if(currentSearchText().isEmpty()){
-            return i18n("Search");
-        } else {
-            return i18n("Search for %1", currentSearchText());
-        }
-    }
-
     return fileName;
 }
 
@@ -680,7 +684,6 @@ void DolphinViewContainer::slotUrlNavigatorLocationChanged(const QUrl& url)
 
 void DolphinViewContainer::slotUrlSelectionRequested(const QUrl& url)
 {
-    qCDebug(DolphinDebug) << "slotUrlSelectionRequested: " << url;
     m_view->markUrlsAsSelected({url});
     m_view->markUrlAsCurrent(url); // makes the item scroll into view
 }