Changeset View
Changeset View
Standalone View
Standalone View
libtaskmanager/startuptasksmodel.cpp
Show First 20 Lines • Show All 187 Lines • ▼ Show 20 Line(s) | 158 | { | |||
---|---|---|---|---|---|
188 | 188 | | |||
189 | // Try via name ... | 189 | // Try via name ... | ||
190 | if (services.empty() && !name.isEmpty()) { | 190 | if (services.empty() && !name.isEmpty()) { | ||
191 | services = KServiceTypeTrader::self()->query(QStringLiteral("Application"), | 191 | services = KServiceTypeTrader::self()->query(QStringLiteral("Application"), | ||
192 | QStringLiteral("exist Exec and ('%1' =~ Name)").arg(name)); | 192 | QStringLiteral("exist Exec and ('%1' =~ Name)").arg(name)); | ||
193 | } | 193 | } | ||
194 | 194 | | |||
195 | if (!services.empty()) { | 195 | if (!services.empty()) { | ||
196 | const QString &menuId = services.at(0)->menuId(); | ||||
197 | | ||||
198 | // applications: URLs are used to refer to applications by their KService::menuId | ||||
199 | // (i.e. .desktop file name) rather than the absolute path to a .desktop file. | ||||
200 | if (!menuId.isEmpty()) { | ||||
201 | return QUrl(QStringLiteral("applications:") + menuId); | ||||
202 | } | ||||
203 | | ||||
196 | QString path = services.at(0)->entryPath(); | 204 | QString path = services.at(0)->entryPath(); | ||
197 | 205 | | |||
198 | if (path.isEmpty()) { | 206 | if (path.isEmpty()) { | ||
199 | path = services.at(0)->exec(); | 207 | path = services.at(0)->exec(); | ||
200 | } | 208 | } | ||
201 | 209 | | |||
202 | if (!path.isEmpty()) { | 210 | if (!path.isEmpty()) { | ||
203 | launcherUrl = QUrl::fromLocalFile(path); | 211 | launcherUrl = QUrl::fromLocalFile(path); | ||
▲ Show 20 Lines • Show All 71 Lines • Show Last 20 Lines |