Commit d451d703 authored by David Redondo's avatar David Redondo 🏎 Committed by Nate Graham
Browse files

kcm/keys: Always try looking up services by storageId

bfbd9cf1 made it so we allways look
up the desktop file in the kglobalaccel directory. But desktop files
do not necessarily need to be there since kglobalaccel can also look
them up from the normal locations.
Test Plan: Add application in kcm, it should have the correct icon

(cherry picked from commit 6dac3744)
parent 2b648822
......@@ -106,12 +106,11 @@ Component GlobalAccelModel::loadComponent(const QList<KGlobalShortcutInfo> &info
const QString &componentUnique = info[0].componentUniqueName();
const QString &componentFriendly = info[0].componentFriendlyName();
KService::Ptr service;
// The shortcuts were imported by desktop file
if (componentUnique.endsWith(QLatin1String(".desktop"))) {
KService::Ptr service = KService::serviceByStorageId(componentUnique);
// Not a normal desktop file but maybe specific file in kglobalaccel dir
if (!service && componentUnique.endsWith(QLatin1String(".desktop"))) {
service = new KService(QStandardPaths::locate(QStandardPaths::GenericDataLocation, QStringLiteral("kglobalaccel/") + componentUnique));
} else {
service = KService::serviceByStorageId(componentUnique);
if (!service) {
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment