Changeset View
Changeset View
Standalone View
Standalone View
kconf_update/globalaccel.cpp
Show First 20 Lines • Show All 59 Lines • ▼ Show 20 Line(s) | 52 | for (int i = 1; i <= numShortcuts; ++i) { | |||
---|---|---|---|---|---|
60 | //ask globalaccel about the current shortcut rather than parsing it ourselves | 60 | //ask globalaccel about the current shortcut rather than parsing it ourselves | ||
61 | const QList<QKeySequence> shortcut = KGlobalAccel::self()->globalShortcut(QStringLiteral("khotkeys"), id); | 61 | const QList<QKeySequence> shortcut = KGlobalAccel::self()->globalShortcut(QStringLiteral("khotkeys"), id); | ||
62 | QAction action; | 62 | QAction action; | ||
63 | action.setObjectName(id); | 63 | action.setObjectName(id); | ||
64 | action.setProperty("componentName", QStringLiteral("khotkeys")); | 64 | action.setProperty("componentName", QStringLiteral("khotkeys")); | ||
65 | KGlobalAccel::self()->setShortcut(&action, {}); | 65 | KGlobalAccel::self()->setShortcut(&action, {}); | ||
66 | KGlobalAccel::self()->removeAllShortcuts(&action); | 66 | KGlobalAccel::self()->removeAllShortcuts(&action); | ||
67 | if (!shortcut.isEmpty() && !shortcut[0].isEmpty()) { | 67 | if (!shortcut.isEmpty() && !shortcut[0].isEmpty()) { | ||
68 | GlobalAccel::changeMenuEntryShortcut(storageId, shortcut[0]); | 68 | GlobalAccel::changeMenuEntryShortcut(KService::serviceByStorageId(storageId), shortcut[0]); | ||
69 | } | 69 | } | ||
70 | khotkeysrc.deleteGroup(groupName); | 70 | khotkeysrc.deleteGroup(groupName); | ||
71 | khotkeysrc.deleteGroup(groupName + QStringLiteral("Actions")); | 71 | khotkeysrc.deleteGroup(groupName + QStringLiteral("Actions")); | ||
72 | khotkeysrc.deleteGroup(groupName + QStringLiteral("Actions0")); | 72 | khotkeysrc.deleteGroup(groupName + QStringLiteral("Actions0")); | ||
73 | khotkeysrc.deleteGroup(groupName + QStringLiteral("Conditions")); | 73 | khotkeysrc.deleteGroup(groupName + QStringLiteral("Conditions")); | ||
74 | khotkeysrc.deleteGroup(groupName + QStringLiteral("Triggers")); | 74 | khotkeysrc.deleteGroup(groupName + QStringLiteral("Triggers")); | ||
75 | khotkeysrc.deleteGroup(groupName + QStringLiteral("Triggers0")); | 75 | khotkeysrc.deleteGroup(groupName + QStringLiteral("Triggers0")); | ||
76 | } | 76 | } | ||
77 | khotkeysrc.sync(); | 77 | khotkeysrc.sync(); | ||
78 | khotkeys.call(QStringLiteral("reread_configuration")); | 78 | khotkeys.call(QStringLiteral("reread_configuration")); | ||
79 | } | 79 | } |