D24667: [KStatusNotifierItem] Allow left click when menu is null

Konrad Materka noreply at phabricator.kde.org
Thu Oct 17 16:43:20 BST 2019


kmaterka marked 2 inline comments as done.
kmaterka added a comment.


  In D24667#548245 <https://phabricator.kde.org/D24667#548245>, @broulik wrote:
  
  > > bool takeOwnership = true);
  >
  > If only Qt/we used modern C++ features to communicate object ownership :)
  
  
  Hehe, yes. Unfortunately KSNI messes with parent of menu object :/
  
  >> do not delete menu in KSNI
  > 
  > Makes the most sense in some form.
  >  It /could/ be done without additional API by abusing QObject parentship: https://phabricator.kde.org/P479
  > 
  > Then this code being a special case would just set the parent back afterwards. Whether that's actually any better than any explicit boolean method is debatable though.
  
  Believe me, I checked that :) I was thinking about this, but it won't work in this form. There are two reasons. First:
  
    void KStatusNotifierItemPrivate::init(const QString &extraId)
    //...
    QMenu *m = new QMenu(associatedWidget);
  
  associatedWidget can be null or not. I don't know if this is needed, what is the purpose of this code and what are side effects. Probably this can be safely removed.
  Second reason is more serious: QMenu parent must be of QWidget type and KSNI is not a widget.

REPOSITORY
  R289 KNotifications

BRANCH
  master

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

To: kmaterka, davidedmundson, broulik, nicolasfella, #frameworks
Cc: 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/20191017/199ae190/attachment.html>


More information about the Kde-frameworks-devel mailing list