D22424: TextDocument: remove actions from contextmenu on hide already
Friedrich W. H. Kossebau
noreply at phabricator.kde.org
Thu Jul 18 16:52:51 BST 2019
kossebau added a comment.
In D22424#497415 <https://phabricator.kde.org/D22424#497415>, @rjvbb wrote:
> > I'll activate the debug trace on change of my `lastShownMenu` though
>
> I'm doing this (in my patch from D16882 <https://phabricator.kde.org/D16882> which still applies after reverting D22424 <https://phabricator.kde.org/D22424>):
>
> + if (menu != lastShownMenu.data()) {
> + if (lastShownMenu) {
> + qCWarning(SHELL) << "Added items to new contextmenu" << menu;
> + }
> + lastShownMenu = menu;
> + }
>
>
> under the assumption that this will print a warning (enabled in qtlogging.ini) when lastShownMenu will be updated but not the 1st time a ctx menu is opened. Is that assumption wrong, because I'm not seeing any warnings after disabling the CTags menu (and restarting KDevelop for good measure).
There is another condition here: `if (lastShownMenu)`. So if the QMenu object instance got deleted (like there is chance this happens when kxmlgui data is removed first on view switch and nothing else has id of that context menu at that very moment), this condition will not be met and no log will be created. I would propose to add debug log also for the "not lastShownMenu" case to make this visible in the log.
> Wouldn't it be great if something in my patch prevented the re-creation of the ctx menu instance? O:-)
Fear "Something" not closer defined otherwise in software has a small chace of getting the "great" attribute ;)
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/2978bcbf/attachment-0001.html>
More information about the KDevelop-devel
mailing list