Port Workspace::clientShortcutUpdated away from KAction
Does no longer crash when setting a window shortcut.
This commit is contained in:
parent
caae057649
commit
209666538e
1 changed files with 4 additions and 8 deletions
|
@ -1036,17 +1036,13 @@ void Workspace::clientShortcutUpdated(Client* c)
|
||||||
connect(action, SIGNAL(triggered(bool)), c, SLOT(shortcutActivated()));
|
connect(action, SIGNAL(triggered(bool)), c, SLOT(shortcutActivated()));
|
||||||
}
|
}
|
||||||
|
|
||||||
KAction *kaction = qobject_cast<KAction*>(action);
|
|
||||||
// no autoloading, since it's configured explicitly here and is not meant to be reused
|
// 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)
|
// (the key is the window id anyway, which is kind of random)
|
||||||
kaction->setGlobalShortcut(
|
KGlobalAccel::self()->setShortcut(action, QList<QKeySequence>() << c->shortcut().primary(),
|
||||||
c->shortcut(), KAction::ActiveShortcut, KAction::NoAutoloading);
|
KGlobalAccel::NoAutoloading);
|
||||||
kaction->setEnabled(true);
|
action->setEnabled(true);
|
||||||
} else {
|
} else {
|
||||||
KAction *kaction = qobject_cast<KAction*>(action);
|
KGlobalAccel::self()->removeAllShortcuts(action);
|
||||||
if (kaction) {
|
|
||||||
kaction->forgetGlobalShortcut();
|
|
||||||
}
|
|
||||||
delete action;
|
delete action;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue