D16882: [KDevelop/Shell] prevent duplicate added contextmenu actions
René J.V. Bertin
noreply at phabricator.kde.org
Thu Nov 15 15:48:41 GMT 2018
rjvbb added a comment.
> _If_ it is found that the root bug is in KTextEditor, sure.
Each KTextEditor::ViewPrivate has a KateViewInternal instance that inherits QWidget and overrides the contextMenuEvent() method. In that override it obains a QMenu from ViewPrivate::contextMenu() which is where KXMLGUI comes into play and where some disconnect/connect voodoo happens (reconnecting 2 signals from the same emitter to the same receiver, including the aboutToShowContextMenu slot). It then calls that menu's popup() method which triggers ViewPrivate::aboutToShowContextMenu() which in turn emits aboutToShowContextMenu.
The question is thus probably if (and why) KateViewInternal::contextMenuEvent() is called for invisible QWidgets. If that doesn't happen the disconnect/connect voodoo in ViewPrivate::contextMenu() is probably to blame. I remember scratching my head about that bit in the past, shouldn't the disconnect be from *all* receivers?.
See https://bugs.kde.org/show_bug.cgi?id=401069#c2
I don't want to delve any deeper than that into code that isn't mine and I'm not planning to work otherwise. This goes beyond using the CTags plugin in KDevelop (which is someone else's idea) and as far as that use is relevant to me I'm perfectly happy with a workaround (here or in KTextEditor).
> I can only urge you to invest into learning how to do debugging the stuff that you work on. It's basic developer tooling.
Oh, I'm pretty confident I've logged more hours in more different debuggers than you, more than enough to know my strengths and weaknesses.
> > And here the API seems to be the emission of the KTextEditor::View::contextMenuAboutToShow signal, that one should only be done once and for the given view where the menu is shown on: "Signal which is emitted immediately prior to showing the current context menu".
That doesn't say explicitly that there will only be 1 such signal for the active view so this aspect could even be platform dependent.
> generation.s, but seeing myself still part of the near future kdevelop generation, here my banner script: "Stop creating code to work around bug symptoms ."
Another banner would "nobody is paid to fix someone else's bugs" (except for a few poor sods whom I hope get paid really well for it).
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/20181115/d1e30207/attachment.html>
More information about the KDevelop-devel
mailing list