D16882: [KDevelop/Shell] prevent duplicate added contextmenu actions

René J.V. Bertin noreply at phabricator.kde.org
Sat Nov 17 10:58:07 GMT 2018


rjvbb reclaimed this revision.
rjvbb added a comment.
This revision now requires changes to proceed.


  Re-opening because I found an actual flaw in KDevelop after noticing that context menu duplication still occurred when only the active view receives the aboutToShowContextMenu signal.
  
  The `addedContextMenu` member exists because `"we want to remove the added stuff when the menu hides"`. This should of course read "when the menu reopens in again, possibly in a different view".
  The flaw here is that the design forgets that the context menu instance is shared among views. It expects `d->addedContextMenu` to exist and contain the QMenu added by a previous view, but this cannot be the case in the current implementation where the variable is only allocated when the menu is first opened in a given view.
  If the `addedContextMenu` is to be removed in JIT-fashion before reopening the context menu, it should be a static variable.
  
  Fix upcoming.

REPOSITORY
  R32 KDevelop

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

To: rjvbb, #kdevelop, kossebau
Cc: kossebau, kde-frameworks-devel, kdevelop-devel, glebaccon, antismap, iodelay, vbspam, geetamc, Pilzschaf, akshaydeo, surgenight, arrowd
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kdevelop-devel/attachments/20181117/2569cf56/attachment.html>


More information about the KDevelop-devel mailing list