From: Kai Uwe Broulik Date: Thu, 5 Jun 2025 19:07:57 +0000 (+0200) Subject: DolphinQuery: Use prettier URL particularly for local paths X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/commitdiff_plain/b67c5478eaa2808028ec511086f01f34230a9277 DolphinQuery: Use prettier URL particularly for local paths Use toLocalFile() to avoid the 'file://' prefix and use KShell::tildeCollapse that collapses the home path into ~ as is done in many other places. Also strip trailing slash for the other URLs. --- diff --git a/src/search/dolphinquery.cpp b/src/search/dolphinquery.cpp index e23f1f08e..100bac4d0 100644 --- a/src/search/dolphinquery.cpp +++ b/src/search/dolphinquery.cpp @@ -16,6 +16,7 @@ #include #include +#include #include #include @@ -366,7 +367,11 @@ QString DolphinQuery::title() const prettySearchLocation = m_searchPath.fileName(); } if (prettySearchLocation.isEmpty()) { - prettySearchLocation = m_searchPath.toString(QUrl::RemoveAuthority); + if (m_searchPath.isLocalFile()) { + prettySearchLocation = KShell::tildeCollapse(m_searchPath.adjusted(QUrl::StripTrailingSlash).toLocalFile()); + } else { + prettySearchLocation = m_searchPath.toString(QUrl::RemoveAuthority | QUrl::StripTrailingSlash); + } } // A great title clearly identifies a search results page among many tabs, windows, or links in the Places panel.