Commit 99908ccb authored by Alexander Lohnau's avatar Alexander Lohnau 💬
Browse files

systemsettings runner: Ensure that we match keywords case insensitively

BUG: 451634
parent 5319864a
Pipeline #154993 passed with stage
in 1 minute and 26 seconds
...@@ -159,7 +159,7 @@ void SystemsettingsRunner::matchNameKeywordAndGenericName(Plasma::RunnerContext ...@@ -159,7 +159,7 @@ void SystemsettingsRunner::matchNameKeywordAndGenericName(Plasma::RunnerContext
const QString &query = ctx.query(); const QString &query = ctx.query();
const QStringList keywords = data.value(QStringLiteral("X-KDE-Keywords")).split(QLatin1Char(',')); const QStringList keywords = data.value(QStringLiteral("X-KDE-Keywords")).split(QLatin1Char(','));
bool anyKeywordMatches = std::any_of(keywords.begin(), keywords.end(), [&query](const QString &keyword) { bool anyKeywordMatches = std::any_of(keywords.begin(), keywords.end(), [&query](const QString &keyword) {
return keyword.startsWith(query); return keyword.startsWith(query, Qt::CaseInsensitive);
}); });
if (anyKeywordMatches && keywords.contains(query, Qt::CaseInsensitive)) { 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 relevance = 0.5; // If the keyword matches exactly we give it the same relevance as if the description matched
......
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