From b63c83e645eb496d232e42d61a8489e20bc15b29 Mon Sep 17 00:00:00 2001 From: Alexander Lohnau Date: Sat, 28 May 2022 11:56:14 +0200 Subject: [PATCH] runners/baloo: Reduce match type when query is not in filename This can be the case, if one indexes the file content --- runners/baloo/baloosearchrunner.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/runners/baloo/baloosearchrunner.cpp b/runners/baloo/baloosearchrunner.cpp index 25cf9500c..65e839666 100644 --- a/runners/baloo/baloosearchrunner.cpp +++ b/runners/baloo/baloosearchrunner.cpp @@ -130,7 +130,7 @@ RemoteMatches SearchRunner::matchInternal(const QString &searchTerm, const QStri match.text = url.fileName(); match.iconName = mimeDb.mimeTypeForFile(localUrl).iconName(); match.relevance = relevance; - match.type = Plasma::QueryMatch::PossibleMatch; + match.type = url.fileName().contains(searchTerm, Qt::CaseInsensitive) ? Plasma::QueryMatch::PossibleMatch : Plasma::QueryMatch::CompletionMatch; QVariantMap properties; QString folderPath = url.adjusted(QUrl::RemoveFilename | QUrl::StripTrailingSlash).toLocalFile();