Commit 68a28076 authored by David Edmundson's avatar David Edmundson

Only match service text strings once

Summary: Minor optimisation, should behave identically.

Test Plan:
Ran krunner
Searched for some apps

Reviewers: #plasma, apol

Reviewed By: apol

Subscribers: plasma-devel

Tags: #plasma

Differential Revision: https://phabricator.kde.org/D19475
parent e588bebe
......@@ -360,8 +360,8 @@ private:
}
seen(action);
if (!action.text().contains(term, Qt::CaseInsensitive)) {
const int matchIndex = action.text().indexOf(term, 0, Qt::CaseInsensitive);
if (matchIndex < 0) {
continue;
}
......@@ -377,7 +377,7 @@ private:
match.setData(action.exec());
qreal relevance = 0.5;
if (action.text().startsWith(term, Qt::CaseInsensitive)) {
if (matchIndex == 0) {
relevance += 0.05;
}
......
Markdown is supported
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