[PlasmaComponents Menu] Don't crash on null action

Authored by broulik on Jul 11 2017, 10:23 AM.

Description

[PlasmaComponents Menu] Don't crash on null action

You can assign a QAction as "action", this way you can just pass it e.g. plasmoid.action("configure").
However, when assigning a null action as can happen with kiosk restrictions, it would crash
as it assigns m_action the nullptr but never checks for that.

This patch ensures we always have a QAction, creating a new empty one, if neccessary.
Also deletes our own action if an external one is assigned

Differential Revision: https://phabricator.kde.org/D6608

Details

Committed
broulikJul 11 2017, 10:23 AM
Differential Revision
D6608: [PlasmaComponents Menu] Don't crash on null action
Parents
R242:c00069c43db4: Use new connect syntax in more places
Branches
Unknown
Tags
Unknown