Changeset View
Changeset View
Standalone View
Standalone View
libtaskmanager/startuptasksmodel.cpp
Show First 20 Lines • Show All 158 Lines • ▼ Show 20 Line(s) | 158 | { | |||
---|---|---|---|---|---|
159 | QUrl launcherUrl; | 159 | QUrl launcherUrl; | ||
160 | KService::List services; | 160 | KService::List services; | ||
161 | 161 | | |||
162 | QString appId = data.applicationId(); | 162 | QString appId = data.applicationId(); | ||
163 | 163 | | |||
164 | // Try to match via desktop filename ... | 164 | // Try to match via desktop filename ... | ||
165 | if (!appId.isEmpty() && appId.endsWith(QLatin1String(".desktop"))) { | 165 | if (!appId.isEmpty() && appId.endsWith(QLatin1String(".desktop"))) { | ||
166 | if (appId.startsWith(QLatin1String("/"))) { | 166 | if (appId.startsWith(QLatin1String("/"))) { | ||
167 | // Even if we have an absolute path, try resolving to a service first (Bug 385594) | ||||
168 | KService::Ptr service = KService::serviceByDesktopPath(appId); | ||||
169 | if (!service) { // No luck, just return it verbatim | ||||
167 | launcherUrl = QUrl::fromLocalFile(appId); | 170 | launcherUrl = QUrl::fromLocalFile(appId); | ||
168 | return launcherUrl; | 171 | return launcherUrl; | ||
172 | } | ||||
173 | | ||||
174 | // Fall-through to menuId() handling below | ||||
175 | services = {service}; | ||||
169 | } else { | 176 | } else { | ||
170 | if (appId.endsWith(QLatin1String(".desktop"))) { | 177 | if (appId.endsWith(QLatin1String(".desktop"))) { | ||
171 | appId = appId.mid(appId.length() - 8); | 178 | appId = appId.mid(appId.length() - 8); | ||
172 | } | 179 | } | ||
173 | 180 | | |||
174 | services = KServiceTypeTrader::self()->query(QStringLiteral("Application"), | 181 | services = KServiceTypeTrader::self()->query(QStringLiteral("Application"), | ||
175 | QStringLiteral("exist Exec and ('%1' =~ DesktopEntryName)").arg(appId)); | 182 | QStringLiteral("exist Exec and ('%1' =~ DesktopEntryName)").arg(appId)); | ||
176 | } | 183 | } | ||
▲ Show 20 Lines • Show All 106 Lines • Show Last 20 Lines |