Changeset View
Changeset View
Standalone View
Standalone View
runners/services/servicerunner.cpp
Show First 20 Lines • Show All 235 Lines • ▼ Show 20 Line(s) | 227 | foreach (const KService::Ptr &service, services) { | |||
---|---|---|---|---|---|
236 | Plasma::QueryMatch match(m_runner); | 236 | Plasma::QueryMatch match(m_runner); | ||
237 | match.setType(Plasma::QueryMatch::PossibleMatch); | 237 | match.setType(Plasma::QueryMatch::PossibleMatch); | ||
238 | setupMatch(service, match); | 238 | setupMatch(service, match); | ||
239 | qreal relevance(0.6); | 239 | qreal relevance(0.6); | ||
240 | 240 | | |||
241 | // If the term was < 3 chars and NOT at the beginning of the App's name or Exec, then | 241 | // If the term was < 3 chars and NOT at the beginning of the App's name or Exec, then | ||
242 | // chances are the user doesn't want that app. | 242 | // chances are the user doesn't want that app. | ||
243 | if (weightedTermLength < 3) { | 243 | if (weightedTermLength < 3) { | ||
244 | if (name.startsWith(term) || exec.startsWith(term)) { | 244 | if (name.startsWith(term, Qt::CaseInsensitive) || exec.startsWith(term, Qt::CaseInsensitive)) { | ||
245 | relevance = 0.9; | 245 | relevance = 0.9; | ||
246 | } else { | 246 | } else { | ||
247 | continue; | 247 | continue; | ||
248 | } | 248 | } | ||
249 | } else if (service->name().contains(queryList[0], Qt::CaseInsensitive)) { | 249 | } else if (service->name().contains(queryList[0], Qt::CaseInsensitive)) { | ||
250 | relevance = 0.8; | 250 | relevance = 0.8; | ||
251 | relevance += increaseMatchRelavance(service, queryList, QStringLiteral("Name")); | 251 | relevance += increaseMatchRelavance(service, queryList, QStringLiteral("Name")); | ||
252 | 252 | | |||
▲ Show 20 Lines • Show All 225 Lines • Show Last 20 Lines |