runners/services: Port to KApplicationTrader in matchExectuables

wilder-5.25
Fushan Wen 4 years ago
parent 7e29307a8e
commit bc9a9cffc8
No known key found for this signature in database
GPG Key ID: 2E48D1487C91DCAA
  1. 9
      runners/services/servicerunner.cpp

@ -183,11 +183,10 @@ private:
return; return;
} }
// Search for applications which are executable and case-insensitively match the search term const auto executablesFilter = [this](const KService::Ptr &service) {
// See https://techbase.kde.org/Development/Tutorials/Services/Traders#The_KTrader_Query_Language return QString::compare(service->name(), term, Qt::CaseInsensitive) == 0;
// if the following is unclear to you. };
query = QStringLiteral("exist Exec and ('%1' =~ Name)").arg(term); const KService::List services = KApplicationTrader::query(executablesFilter);
const KService::List services = KServiceTypeTrader::self()->query(QStringLiteral("Application"), query);
if (services.isEmpty()) { if (services.isEmpty()) {
return; return;

Loading…
Cancel
Save