]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/dolphinviewcontainer.cpp
[Details mode] Allow to fill the column size of directories with actual size
[dolphin.git] / src / dolphinviewcontainer.cpp
index 3a17805ab8916667d15752c942c699fdcccc1b24..4ab34a06a85ef1632c6bdd8ed499489a1e03023b 100644 (file)
@@ -29,6 +29,8 @@
 #include "trash/dolphintrash.h"
 #include "views/viewmodecontroller.h"
 #include "views/viewproperties.h"
+#include "dolphin_detailsmodesettings.h"
+#include "views/dolphinview.h"
 
 #ifdef HAVE_KACTIVITIES
 #include <KActivities/ResourceInstance>
@@ -119,7 +121,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 "
@@ -249,6 +251,12 @@ DolphinViewContainer::DolphinViewContainer(const QUrl& url, QWidget* parent) :
 
     setSearchModeEnabled(isSearchUrl(url));
 
+    connect(DetailsModeSettings::self(), &KCoreConfigSkeleton::configChanged, this, [=]() {
+        if (view()->mode() == DolphinView::Mode::DetailsView) {
+            view()->reload();
+        }
+    });
+
     // Initialize kactivities resource instance
 
 #ifdef HAVE_KACTIVITIES
@@ -449,6 +457,18 @@ void DolphinViewContainer::reload()
     m_messageWidget->hide();
 }
 
+QString DolphinViewContainer::captionWindowTitle() const
+{
+    if (GeneralSettings::showFullPathInTitlebar() && !isSearchModeEnabled()) {
+        if (!url().isLocalFile()) {
+            return url().adjusted(QUrl::StripTrailingSlash).toString();
+        }
+        return url().adjusted(QUrl::StripTrailingSlash).path();
+    } else {
+        return DolphinViewContainer::caption();
+    }
+}
+
 QString DolphinViewContainer::caption() const
 {
     if (isSearchModeEnabled()) {
@@ -459,13 +479,6 @@ QString DolphinViewContainer::caption() const
         }
     }
 
-    if (GeneralSettings::showFullPathInTitlebar()) {
-        if (!url().isLocalFile()) {
-            return url().adjusted(QUrl::StripTrailingSlash).toString();
-        }
-        return url().adjusted(QUrl::StripTrailingSlash).path();
-    }
-
     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);