diff options
| author | Kai Uwe Broulik <[email protected]> | 2024-07-24 13:50:35 +0200 |
|---|---|---|
| committer | Kai Uwe Broulik <[email protected]> | 2024-07-24 13:50:35 +0200 |
| commit | 80d2ea0bcc37737348b1df1691e21763272d0157 (patch) | |
| tree | 0a8617e033f12b38bef09675afe19a7a735b0672 | |
| parent | 06b367c1a8d93061d385ffb235d302e22df20070 (diff) | |
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
| -rw-r--r-- | src/dolphinviewcontainer.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
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 <QRegularExpression> #include <QTimer> #include <QUrl> +#include <QUrlQuery> // 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"); |
