Remove KCM query logic from services runner

It gets moved to systemsettings, see https://invent.kde.org/plasma/systemsettings/-/merge_requests/73 for the rationale

This way the runner only shows applications, like it's name in the plugin selector suggests.
wilder-5.24
Alexander Lohnau 5 years ago
parent 42515d22cb
commit 5844df73ad
  1. 19
      runners/services/servicerunner.cpp

@ -239,11 +239,10 @@ private:
query = generateQuery(queryList);
}
KService::List services = KServiceTypeTrader::self()->query(QStringLiteral("Application"), query);
services += KServiceTypeTrader::self()->query(QStringLiteral("KCModule"), query);
const KService::List services = KServiceTypeTrader::self()->query(QStringLiteral("Application"), query);
qCDebug(RUNNER_SERVICES) << "got " << services.count() << " services from " << query;
for (const KService::Ptr &service : qAsConst(services)) {
for (const KService::Ptr &service : services) {
if (disqualify(service)) {
continue;
}
@ -295,23 +294,11 @@ private:
}
}
const bool isKCM = service->serviceTypes().contains(QLatin1String("KCModule"));
if (!isKCM && (service->categories().contains(QLatin1String("KDE")) || service->serviceTypes().contains(QLatin1String("KCModule")))) {
if (service->categories().contains(QLatin1String("KDE"))) {
qCDebug(RUNNER_SERVICES) << "found a kde thing" << id << match.subtext() << relevance;
relevance += .09;
}
if (isKCM) {
if (service->parentApp() == QStringLiteral("kinfocenter")) {
match.setMatchCategory(i18n("System Information"));
} else {
match.setMatchCategory(i18n("System Settings"));
}
// KCMs are, on the balance, less relevant. Drop it ever so much. So they may get outscored
// by an otherwise equally applicable match.
relevance -= .001;
}
qCDebug(RUNNER_SERVICES) << service->name() << "is this relevant:" << relevance;
match.setRelevance(relevance);

Loading…
Cancel
Save