Changeset View
Changeset View
Standalone View
Standalone View
applets/taskmanager/plugin/backend.cpp
Show First 20 Lines • Show All 305 Lines • ▼ Show 20 Line(s) | 287 | { | |||
---|---|---|---|---|---|
306 | 306 | | |||
307 | auto query = UsedResources | 307 | auto query = UsedResources | ||
308 | | RecentlyUsedFirst | 308 | | RecentlyUsedFirst | ||
309 | | Agent(storageId) | 309 | | Agent(storageId) | ||
310 | | Type::any() | 310 | | Type::any() | ||
311 | | Activity::current() | 311 | | Activity::current() | ||
312 | | Url::file(); | 312 | | Url::file(); | ||
313 | 313 | | |||
314 | // Due to KRecentDocument::add() bug, application name "<app>" could | | |||
315 | // be stored instead of its desktop entry name "org.kde.<app>". Let's | | |||
316 | // check for both in order to get all results for the application. | | |||
317 | if (storageId.startsWith(QLatin1String("org.kde."))) { | | |||
318 | query = query | Agent(storageId.mid(8)); | | |||
319 | } | | |||
320 | | ||||
321 | ResultSet results(query); | 314 | ResultSet results(query); | ||
322 | 315 | | |||
323 | ResultSet::const_iterator resultIt = results.begin(); | 316 | ResultSet::const_iterator resultIt = results.begin(); | ||
324 | 317 | | |||
325 | int actionCount = 0; | 318 | int actionCount = 0; | ||
326 | 319 | | |||
327 | while (actionCount < 5 && resultIt != results.end()) { | 320 | while (actionCount < 5 && resultIt != results.end()) { | ||
328 | const QString resource = (*resultIt).resource(); | 321 | const QString resource = (*resultIt).resource(); | ||
▲ Show 20 Lines • Show All 74 Lines • ▼ Show 20 Line(s) | 381 | { | |||
403 | 396 | | |||
404 | if (desktopPath.isEmpty() || resource.isEmpty()) { | 397 | if (desktopPath.isEmpty() || resource.isEmpty()) { | ||
405 | auto query = UsedResources | 398 | auto query = UsedResources | ||
406 | | Agent(agent) | 399 | | Agent(agent) | ||
407 | | Type::any() | 400 | | Type::any() | ||
408 | | Activity::current() | 401 | | Activity::current() | ||
409 | | Url::file(); | 402 | | Url::file(); | ||
410 | 403 | | |||
411 | // Due to KRecentDocument::add() bug, application name "<app>" could | | |||
412 | // be stored instead of its desktop entry name "org.kde.<app>". Let's | | |||
413 | // check for both in order to get all results for the application. | | |||
414 | if (agent.startsWith(QLatin1String("org.kde."))) { | | |||
415 | query = query | Agent(agent.mid(8)); | | |||
416 | } | | |||
417 | | ||||
418 | KAStats::forgetResources(query); | 404 | KAStats::forgetResources(query); | ||
419 | 405 | | |||
420 | return; | 406 | return; | ||
421 | } | 407 | } | ||
422 | 408 | | |||
423 | KService::Ptr service = KService::serviceByDesktopPath(desktopPath); | 409 | KService::Ptr service = KService::serviceByDesktopPath(desktopPath); | ||
424 | 410 | | |||
425 | qDebug() << service; | 411 | qDebug() << service; | ||
▲ Show 20 Lines • Show All 175 Lines • Show Last 20 Lines |