Summary: | KTextEditor: aboutToShowContextMenu is emitted for all open documents | ||
---|---|---|---|
Product: | [Frameworks and Libraries] frameworks-ktexteditor | Reporter: | RJVB <rjvbertin> |
Component: | general | Assignee: | KWrite Developers <kwrite-bugs-null> |
Status: | RESOLVED FIXED | ||
Severity: | normal | ||
Priority: | NOR | ||
Version: | unspecified | ||
Target Milestone: | --- | ||
Platform: | Compiled Sources | ||
OS: | All | ||
Latest Commit: | https://commits.kde.org/ktexteditor/3f0c617e22ab5d2ae016ef7858c6f451f9cf0ad0 | Version Fixed In: | |
Sentry Crash Report: | |||
Attachments: | potential fix |
Description
RJVB
2018-11-15 14:31:09 UTC
Addendum: Is this intended behaviour or a bug that was never detected because it never caused visible side-effects? Created attachment 116327 [details]
potential fix
2-hunk patch:
- Hunk 2 is a protection against emitting the signal multiple times
- Hunk 1 appears to be a fix based on the following hypothesis:
If the menu obtained from KXMLGUI is always the same (QMenu instance) then its aboutToShow and aboutToHide signals should be disconnected from all receivers before connecting them to "this". It makes no sense I can see to disconnect from "this" and then reconnect to exactly the same slots.
Git commit 3f0c617e22ab5d2ae016ef7858c6f451f9cf0ad0 by René J.V. Bertin. Committed on 17/11/2018 at 13:40. Pushed by rjvbb into branch 'master'. disconnect contextmenu from all aboutToXXContextMenu receivers Context menus are shown in a single view at a time so only the active KTextEditor::ViewPrivate instance should be signalled when a context menu is about to show or hide. Differential Revision: https://phabricator.kde.org/D16927 M +7 -2 src/view/kateview.cpp https://commits.kde.org/ktexteditor/3f0c617e22ab5d2ae016ef7858c6f451f9cf0ad0 |