From 209666538e64618f82b423609b4d919777f82415 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Gr=C3=A4=C3=9Flin?= Date: Mon, 19 Aug 2013 13:51:29 +0200 Subject: [PATCH] Port Workspace::clientShortcutUpdated away from KAction Does no longer crash when setting a window shortcut. --- useractions.cpp | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/useractions.cpp b/useractions.cpp index 26ca0a5536..30ac429533 100755 --- a/useractions.cpp +++ b/useractions.cpp @@ -1036,17 +1036,13 @@ void Workspace::clientShortcutUpdated(Client* c) connect(action, SIGNAL(triggered(bool)), c, SLOT(shortcutActivated())); } - KAction *kaction = qobject_cast(action); // no autoloading, since it's configured explicitly here and is not meant to be reused // (the key is the window id anyway, which is kind of random) - kaction->setGlobalShortcut( - c->shortcut(), KAction::ActiveShortcut, KAction::NoAutoloading); - kaction->setEnabled(true); + KGlobalAccel::self()->setShortcut(action, QList() << c->shortcut().primary(), + KGlobalAccel::NoAutoloading); + action->setEnabled(true); } else { - KAction *kaction = qobject_cast(action); - if (kaction) { - kaction->forgetGlobalShortcut(); - } + KGlobalAccel::self()->removeAllShortcuts(action); delete action; } }