From b31aea192c2f295e79c6382df407844466c9d275 Mon Sep 17 00:00:00 2001 From: Kai Uwe Broulik Date: Thu, 31 Dec 2020 19:35:37 +0100 Subject: [PATCH] Baloo Runner: Use KShell::tildeCollapse Rather than doing it manually --- runners/baloo/baloosearchrunner.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/runners/baloo/baloosearchrunner.cpp b/runners/baloo/baloosearchrunner.cpp index 2d321369f..c5f03dac4 100644 --- a/runners/baloo/baloosearchrunner.cpp +++ b/runners/baloo/baloosearchrunner.cpp @@ -184,9 +184,7 @@ RemoteMatches SearchRunner::matchInternal(const QString& searchTerm, const QStri QVariantMap properties; QString folderPath = url.adjusted(QUrl::RemoveFilename | QUrl::StripTrailingSlash).toLocalFile(); - if (folderPath.startsWith(QDir::homePath())) { - folderPath.replace(0, QDir::homePath().length(), QStringLiteral("~")); - } + folderPath = KShell::tildeCollapse(folderPath); properties[QStringLiteral("urls")] = QStringList({QString::fromLocal8Bit(url.toEncoded())}); properties[QStringLiteral("subtext")] = folderPath;