Review Request 127645: Add overload for adding a MenuItem at a specific position

Eike Hein hein at kde.org
Wed Apr 13 16:13:47 UTC 2016


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/127645/
-----------------------------------------------------------

(Updated April 13, 2016, 4:13 p.m.)


Review request for Plasma.


Changes
-------

Drop overload; Marco points out we can break BC at will here.


Repository: plasma-framework


Description (updated)
-------

This adds a second MenuItem parameter to addMenuItem, which is used as a position reference for inserting the new item.

The resulting API matches QWidget::insertAction in spirit.

Implicitly allows reordering items in the menu by removing and reinserting if an item already exists (adding actions multiple times was already not supported due to "A QWidget should only have one of each action and adding an action it already has will not cause the same action to be in the widget twice." in the underlying implementation). This is actually quite useful because it aligns well with parenting a PlasmaComponents.MenuItem initially to the menu via Qt.createQmlObject(), then moving it into the desired place before opening the menu.

This will be used by the Task Manager applet for dynamically adding actions for recent docs and jump list actions to a task context menu.


Diffs (updated)
-----

  src/declarativeimports/plasmacomponents/qmenu.h baee963 
  src/declarativeimports/plasmacomponents/qmenu.cpp d84f481 

Diff: https://git.reviewboard.kde.org/r/127645/diff/


Testing
-------


Thanks,

Eike Hein

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/plasma-devel/attachments/20160413/6f8d8991/attachment.html>


More information about the Plasma-devel mailing list