X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/blobdiff_plain/7a2885853a424042cb631f83a1db278560679d9e..e6ea3ab4c41dcc115143a237aafd3a1152849433:/src/dolphinviewcontainer.cpp diff --git a/src/dolphinviewcontainer.cpp b/src/dolphinviewcontainer.cpp index bd3c8ed20..4ab34a06a 100644 --- a/src/dolphinviewcontainer.cpp +++ b/src/dolphinviewcontainer.cpp @@ -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 @@ -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", "This helps you find files and folders. Enter a " "search term 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,22 +457,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 +479,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;