From: Kai Uwe Broulik Date: Wed, 24 Jul 2024 11:50:35 +0000 (+0200) Subject: DolphinViewContainer: Check "title" URL query if no path is given X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/commitdiff_plain/80d2ea0bcc37737348b1df1691e21763272d0157?ds=inline 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 --- 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");