Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Plasma
System Settings
Commits
a08ce248
Commit
a08ce248
authored
Jan 12, 2022
by
Alexander Lohnau
💬
Committed by
Nate Graham
Jan 13, 2022
Browse files
systemsettings runner: Consider KCM keywords for querying
BUG: 445304
FIXED-IN: 5.24
parent
6ff53baf
Pipeline
#122941
passed with stage
in 53 seconds
Changes
1
Pipelines
3
Hide whitespace changes
Inline
Side-by-side
runner/systemsettingsrunner.cpp
View file @
a08ce248
...
...
@@ -153,8 +153,19 @@ void SystemsettingsRunner::matchNameKeywordAndGenericName(Plasma::RunnerContext
relevance
+=
0.1
;
}
}
else
{
// check if the generic name or description matches
if
(
!
checkMatchAndRelevance
(
data
.
value
(
QStringLiteral
(
"GenericName"
)),
0.65
)
&&
!
checkMatchAndRelevance
(
data
.
description
(),
0.5
))
{
continue
;
// if not, check the keyowords
const
QString
&
query
=
ctx
.
query
();
const
QStringList
keywords
=
data
.
value
(
QStringLiteral
(
"X-KDE-Keywords"
)).
split
(
QLatin1Char
(
','
));
bool
anyKeywordMatches
=
std
::
any_of
(
keywords
.
begin
(),
keywords
.
end
(),
[
&
query
](
const
QString
&
keyword
)
{
return
keyword
.
startsWith
(
query
);
});
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
}
}
}
...
...
Alexander Lohnau
💬
@alex
mentioned in commit
7b706e50
·
Jan 13, 2022
mentioned in commit
7b706e50
mentioned in commit 7b706e507e15135cc1f18aef3e307c6a151ce487
Toggle commit list
Nate Graham
@ngraham
mentioned in merge request
!185 (merged)
·
Jan 03, 2023
mentioned in merge request
!185 (merged)
mentioned in merge request !185
Toggle commit list
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment