Changeset View
Changeset View
Standalone View
Standalone View
applets/taskmanager/package/contents/ui/main.qml
Show First 20 Lines • Show All 229 Lines • ▼ Show 20 Line(s) | 223 | function sourceNameForLauncherUrl(launcherUrl, pid) { | |||
---|---|---|---|---|---|
230 | var desktopFileName = launcherUrl.toString().split('/').pop().split('?')[0].replace(".desktop", "") | 230 | var desktopFileName = launcherUrl.toString().split('/').pop().split('?')[0].replace(".desktop", "") | ||
231 | 231 | | |||
232 | for (var i = 0, length = connectedSources.length; i < length; ++i) { | 232 | for (var i = 0, length = connectedSources.length; i < length; ++i) { | ||
233 | var source = connectedSources[i]; | 233 | var source = connectedSources[i]; | ||
234 | // we intend to connect directly, otherwise the multiplexer steals the connection away | 234 | // we intend to connect directly, otherwise the multiplexer steals the connection away | ||
235 | if (source === "@multiplex") { | 235 | if (source === "@multiplex") { | ||
236 | continue; | 236 | continue; | ||
237 | } | 237 | } | ||
238 | | ||||
238 | var sourceData = data[source]; | 239 | var sourceData = data[source]; | ||
239 | if (sourceData && sourceData.DesktopEntry === desktopFileName && (pid === undefined || sourceData.InstancePid === pid)) { | 240 | if (!sourceData || sourceData.DesktopEntry !== desktopFileName) { | ||
241 | continue; | ||||
242 | } | ||||
243 | | ||||
244 | if (pid === undefined || sourceData.InstancePid === pid) { | ||||
240 | return source; | 245 | return source; | ||
241 | } | 246 | } | ||
247 | | ||||
248 | var metadata = sourceData.Metadata; | ||||
249 | if (metadata) { | ||||
250 | var kdePid = metadata["kde:pid"]; | ||||
251 | if (kdePid && pid === kdePid) { | ||||
252 | return source; | ||||
253 | } | ||||
254 | } | ||||
242 | } | 255 | } | ||
243 | 256 | | |||
244 | return "" | 257 | return "" | ||
245 | } | 258 | } | ||
246 | 259 | | |||
247 | function startOperation(source, op) { | 260 | function startOperation(source, op) { | ||
248 | var service = serviceForSource(source) | 261 | var service = serviceForSource(source) | ||
249 | var operation = service.operationDescription(op) | 262 | var operation = service.operationDescription(op) | ||
▲ Show 20 Lines • Show All 220 Lines • Show Last 20 Lines |