From 80d2ea0bcc37737348b1df1691e21763272d0157 Mon Sep 17 00:00:00 2001 From: Kai Uwe Broulik Date: Wed, 24 Jul 2024 13:50:35 +0200 Subject: [PATCH] DolphinViewContainer: Check "title" URL query if no path is given Makes it consistent with `KUrlNavigator` which checks a "title" query if no path is given, e.g. in baloosearch --- src/dolphinviewcontainer.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/dolphinviewcontainer.cpp b/src/dolphinviewcontainer.cpp index 3fedef6fc..f0035a857 100644 --- a/src/dolphinviewcontainer.cpp +++ b/src/dolphinviewcontainer.cpp @@ -41,6 +41,7 @@ #include #include #include +#include // An overview of the widgets contained by this ViewContainer struct LayoutStructure { @@ -533,6 +534,15 @@ QString DolphinViewContainer::captionWindowTitle() const QString DolphinViewContainer::caption() const { + // see KUrlNavigatorPrivate::firstButtonText(). + if (url().path().isEmpty() || url().path() == QLatin1Char('/')) { + QUrlQuery query(url()); + const QString title = query.queryItemValue(QStringLiteral("title")); + if (!title.isEmpty()) { + return title; + } + } + if (isSearchModeEnabled()) { if (currentSearchText().isEmpty()) { return i18n("Search"); -- 2.47.3