Commit 06df6b61 authored by Alexander Lohnau's avatar Alexander Lohnau 💬
Browse files

Systemsettings runner: Increase relevance if we have an exact match in the keywords

This way we treat an exact match in the keywords like if the query is contained in the description.
parent d8331e1a
Pipeline #132105 passed with stage
in 49 seconds
......@@ -161,7 +161,9 @@ void SystemsettingsRunner::matchNameKeywordAndGenericName(Plasma::RunnerContext
bool anyKeywordMatches = std::any_of(keywords.begin(), keywords.end(), [&query](const QString &keyword) {
return keyword.startsWith(query);
});
if (anyKeywordMatches) {
if (anyKeywordMatches && keywords.contains(query, Qt::CaseInsensitive)) {
relevance = 0.5; // If the keyword matches exactly we give it the same relevance as if the description matched
} else if (anyKeywordMatches) {
relevance = 0.2; // give it a lower relevance than if it had been found by name or description
} else {
continue; // we haven't found any matching keyword, skip this KCM
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment