Review Request 124637: ContextMenuMutator - fix - remove (manually created) submenu when parent menu is hid

Maciej Poleski d82ks8djf82msd83hf8sc02lqb5gh5 at gmail.com
Thu Aug 6 22:34:53 UTC 2015



> On Sie 7, 2015, 12:17 rano, Milian Wolff wrote:
> > refactoring/contextmenumutator.cpp, line 107
> > <https://git.reviewboard.kde.org/r/124637/diff/1/?file=390525#file390525line107>
> >
> >     you'll still leak the `EventFilter`, no? Why not make the `ContextMenuMutator` the eventFilter?

In exactly this line `EventFilter` becomes child of submenu. When `EventFilter` decide to delete submenu, its destruction will trigger destruction of `EventFilter`.
I didn't consider `ContextMenuMutator` an eventFilter. What should be noted is that we may have more than one submenu generated and thus more than one `EventFilter`. It would influance design of `EventFilter` (many-to-one instead of one-to-one). I just didn't consider this idea.


- Maciej


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/124637/#review83518
-----------------------------------------------------------


On Sie 6, 2015, 12:37 rano, Maciej Poleski wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://git.reviewboard.kde.org/r/124637/
> -----------------------------------------------------------
> 
> (Updated Sie 6, 2015, 12:37 rano)
> 
> 
> Review request for KDevelop.
> 
> 
> Repository: kdev-clang
> 
> 
> Description
> -------
> 
> ContextMenuMutator - remove manually created submenu when parent menu is hid
> 
> It looks like context menu is long living. But every new opening populates with (potentially) new "Refactorings" submenu.
> This fix introduces event filter watching for hide events on context menu (but only if submenu was created). hide event -> `submenu->deleteLater()`
> 
> 
> Diffs
> -----
> 
>   refactoring/contextmenumutator.h PRE-CREATION 
>   refactoring/contextmenumutator.cpp PRE-CREATION 
> 
> Diff: https://git.reviewboard.kde.org/r/124637/diff/
> 
> 
> Testing
> -------
> 
> Manual testing.
> 
> 
> Thanks,
> 
> Maciej Poleski
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kdevelop-devel/attachments/20150806/575a1777/attachment-0001.html>


More information about the KDevelop-devel mailing list