D24755: [KStatusNotifierItem] Optionaly, do not take menu ownership

Konrad Materka noreply at phabricator.kde.org
Sat Oct 19 11:18:26 BST 2019


kmaterka added inline comments.

INLINE COMMENTS

> davidedmundson wrote in kstatusnotifieritemprivate_p.h:158
> QPointer here won't solve the other hacks needed.
> 
> We have MenuSource, Menu and KSNI
> 
> QPointer would fix the case of MenuSource still owning the Menu and KSNI lasting longer than the Menu.
> 
> But we need things the other way round.
> 
> We have MenuSource lasting longer than KSNI we need to supply a menu to the KSNI but keep the menu after the KSNI is deleted. QPointer won't solve that.
> 
> (might be worth switching this to a QPointer anyway, now that ksni doesn't control the menu lifespan though)

I will wrap m_menu in QPointer. When mane "ownership" is outside of the KSNI this is a valid case when menu is deleted before KSNI. That's a good practice anyway.

REPOSITORY
  R289 KNotifications

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

To: kmaterka, #frameworks, davidedmundson, broulik, nicolasfella
Cc: anthonyfieroni, kde-frameworks-devel, LeGast00n, GB_2, michaelh, ngraham, bruns
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-frameworks-devel/attachments/20191019/801d42d1/attachment.html>


More information about the Kde-frameworks-devel mailing list