diff --git a/applets/kicker/plugin/actionlist.cpp b/applets/kicker/plugin/actionlist.cpp --- a/applets/kicker/plugin/actionlist.cpp +++ b/applets/kicker/plugin/actionlist.cpp @@ -186,19 +186,29 @@ return false; } -// HACK TEMP FIXME TODO IVAN -QString storageIdFromService(KService::Ptr service) +QString storageIdFromService(KService::Ptr service, bool &storageIdWasCut, QString &uncutStorageId) { QString storageId = service->storageId(); - if (storageId.startsWith("org.kde.")) { - storageId = storageId.right(storageId.length() - 8); - } - if (storageId.endsWith(".desktop")) { storageId = storageId.left(storageId.length() - 8); } + /* + * HACK This is a temporary hack to make sure nothing breaks + * after D10863 is landed. + * + * TODO Remove it when we depend on the Frameworks version + * which contains the above revision. + */ + storageIdWasCut = false; + uncutStorageId = storageId; + + if (storageId.startsWith("org.kde.")) { + storageId = storageId.right(storageId.length() - 8); + storageIdWasCut = true; + } + return storageId; } @@ -233,7 +243,17 @@ return list; } - const QString storageId = storageIdFromService(service); + /* + * HACK This is a temporary hack to make sure nothing breaks + * after D10863 is landed. + * + * TODO Remove it when we depend on the Frameworks version + * which contains the above revision. + */ + bool storageIdWasCut; + QString uncutStorageId; + + const QString storageId = storageIdFromService(service, storageIdWasCut, uncutStorageId); if (storageId.isEmpty()) { return list; @@ -246,6 +266,10 @@ | Activity::current() | Url::file(); + if (storageIdWasCut) { + query = query | Agent(uncutStorageId); + } + ResultSet results(query); ResultSet::const_iterator resultIt; @@ -291,7 +315,17 @@ } if (actionId == "_kicker_forgetRecentDocuments") { - const QString storageId = storageIdFromService(service); + /* + * HACK This is a temporary hack to make sure nothing breaks + * after D10863 is landed. + * + * TODO Remove it when we depend on the Frameworks version + * which contains the above revision. + */ + bool storageIdWasCut; + QString uncutStorageId; + + const QString storageId = storageIdFromService(service, storageIdWasCut, uncutStorageId); if (storageId.isEmpty()) { return false; @@ -303,6 +337,10 @@ | Activity::current() | Url::file(); + if (storageIdWasCut) { + query = query | Agent(uncutStorageId); + } + KAStats::forgetResources(query); return false; diff --git a/applets/taskmanager/plugin/backend.cpp b/applets/taskmanager/plugin/backend.cpp --- a/applets/taskmanager/plugin/backend.cpp +++ b/applets/taskmanager/plugin/backend.cpp @@ -300,21 +300,36 @@ QString desktopName = desktopEntryUrl.fileName(); QString storageId = desktopName; - if (storageId.startsWith(QLatin1String("org.kde."))) { - storageId = storageId.right(storageId.length() - 8); - } - if (storageId.endsWith(QLatin1String(".desktop"))) { storageId = storageId.left(storageId.length() - 8); } + /* + * HACK This is a temporary hack to make sure nothing breaks + * after D10863 is landed. + * + * TODO Remove it when we depend on the Frameworks version + * which contains the above revision. + */ + bool storageIdWasCut = false; + const QString uncutStorageId = storageId; + + if (storageId.startsWith(QLatin1String("org.kde."))) { + storageId = storageId.right(storageId.length() - 8); + storageIdWasCut = true; + } + auto query = UsedResources | RecentlyUsedFirst | Agent(storageId) | Type::any() | Activity::current() | Url::file(); + if (storageIdWasCut) { + query = query | Agent(uncutStorageId); + } + ResultSet results(query); ResultSet::const_iterator resultIt = results.begin();