Check QAction enablement before triggering

QAction::trigger does not check enablement. File manager's undo action
gets enabled/disabled depending on whether we have anything to undo.

If we unconditionally invoke the method we can crash.

As an aside, the comment about QQuickItem and shortcut looks very
outdated.
This commit is contained in:
David Edmundson 2021-03-02 00:09:56 +00:00
parent 3f218664a5
commit 2ce8590eae

View File

@ -797,6 +797,10 @@ bool AppletInterface::event(QEvent *event)
continue;
}
if (!a->isEnabled()) {
continue;
}
// this will happen on a normal, non emacs shortcut
if (seq.matches(a->shortcut()) == QKeySequence::ExactMatch) {
event->accept();