D6608: [PlasmaComponents Menu] Don't crash on null action

David Edmundson noreply at phabricator.kde.org
Mon Jul 10 13:29:41 UTC 2017


davidedmundson added inline comments.

INLINE COMMENTS

> qmenuitem.cpp:29
>      setAction(new QAction(this));
> +    m_hasExplicitAction = false;
>  }

Another approach I've seen done before is:

if (action->parent() == this) we delete it, else it's the client's problem.

IMHO cleaner, but up to you.

> qmenuitem.cpp:46
> +            if (a) {
> +                m_hasExplicitAction = true;
> +                delete m_action;

you need a setVisible(true);

otherwise setAction(null);   setAction(something) will still be hidden.

REPOSITORY
  R242 Plasma Framework (Library)

REVISION DETAIL
  https://phabricator.kde.org/D6608

To: broulik, #plasma
Cc: davidedmundson, plasma-devel, #frameworks, ZrenBot, progwolff, lesliezhai, ali-mohamed, jensreuterberg, abetts, sebas, apol, mart, lukas
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/plasma-devel/attachments/20170710/786b592f/attachment.html>


More information about the Plasma-devel mailing list