D22424: TextDocument: remove actions from contextmenu on hide already

Friedrich W. H. Kossebau noreply at phabricator.kde.org
Thu Jul 18 13:38:01 BST 2019


kossebau added a comment.


  In D22424#497316 <https://phabricator.kde.org/D22424#497316>, @rjvbb wrote:
  
  > Since we're dealing with "please read/see again": idem for my comment :P which only states that a single QMenu instance is being (re)used. I've never seen it change
  
  
  Please add a line
  
    qDebug() << "Showing context menu" << menu;
  
  to KDevelop::TextDocument::populateContextMenu.
  
  Rebuild & install, then run kdevelop, disable the CTags plugin, have 2 text documents open:
  
  1. invoke context menu a few times on view of document A -> same menu instance CM_A
  2. switch to view of document B, invoke context menu a few times -> same menu instance CM_B (!= CM_A)
  3. switch back to view of document A, invoke context menu a few times -> same menu instance CM_A2 (!=, CM_A, != CM_B)
  
  This is behaviour I pbserved here consistently with KF 5.60.
  
  When enabling the CTags plugin again, suddenly it is always the same menu instance.
  
  If we consider that every time a document is switched, that this internally triggers a remerge of all the menus defined by the kxmlguiclients, due to the xmlgui menu data from the old view being removed and the xmlgui menu data from the new view being added, it is actually not that surprising (well, once one has thought a lot about it :P ) that the context menu object is recreated. Because without any other kxmlgui client injecting a menu of id "ktexteditor_popup" into the system (like the ctags plugin does), when a texteditor view is removed from the shell kxmlgui, nothing else demands/defines a menu with that id, so it gets deleted. And then recreated, because the new view getting active and adding its kxmlgui data has again such a menu defined with that id.

REPOSITORY
  R32 KDevelop

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

To: kossebau, #kdevelop
Cc: anthonyfieroni, rjvbb, kdevelop-devel, hmitonneau, christiant, glebaccon, domson, antismap, iodelay, alexeymin, geetamc, Pilzschaf, akshaydeo, surgenight, arrowd
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kdevelop-devel/attachments/20190718/c2c9a6f5/attachment.html>


More information about the KDevelop-devel mailing list