rkflx added a comment.
Awesome, I did not expect that the fix for the shortcuts would be so simple.
Thanks for your patience, we are nearly there…
INLINE COMMENTS
> ksysguardprocesslist.cpp:421-427
> + //
> + // This is one way of how to find out the two required parameters for
> the globalShortcut method
> + // (maybe there is a better one):
> + // auto list =
> KGlobalAccel::getGlobalShortcutsByKey(QKeySequence(QStringLiteral("Alt+Space")));
> + // foreach (auto item, list) {
> + // qDebug() << item.componentUniqueName() << item.uniqueName();
> + // }
Left-over debug code?
> ksysguardprocesslist.cpp:429
> + auto runCommandShortcutList =
> KGlobalAccel::self()->globalShortcut(QStringLiteral("krunner"),
> QStringLiteral("run command"));
> + QString runCommandShortcut = i18nc("a keyboard shortcut", "not set");
> + if (runCommandShortcutList.size() > 0) {
Do you think it is really necessary to display `not set`? For me, an empty
string would also work just fine, now that you are using `\t` instead of `(…)`.
Also I found a way to omit the string and `\t` entirely and let Qt do all the
work:
auto runCommandAction = new QAction(i18nc("@action:inmenu", "Run Command"),
this);
const auto runCommandShortcutList =
KGlobalAccel::self()->globalShortcut(QStringLiteral("krunner"),
QStringLiteral("run command"));
if (runCommandShortcutList.size() > 0) {
runCommandAction->setShortcut(runCommandShortcutList[0]);
}
REPOSITORY
R111 KSysguard Library
REVISION DETAIL
https://phabricator.kde.org/D10297
To: gregormi, #plasma, colomar, kossebau, broulik, mart, hein, rkflx
Cc: apol, anthonyfieroni, andreaska, rkflx, ngraham, plasma-devel, ragreen,
Pitel, ZrenBot, lesliezhai, ali-mohamed, jensreuterberg, abetts, sebas, mart