D22424: TextDocument: remove actions from contextmenu on hide already

René J.V. Bertin noreply at phabricator.kde.org
Sat Jul 13 10:51:07 BST 2019


rjvbb added a comment.


  Just a few remarks on the comments that should make them easier to understand (a priori comments should illustrate code and not require lots of different code the understand their meaning ;))

INLINE COMMENTS

> textdocument.cpp:89-92
> +        // handle case we are deleted while context menu is not yet hidden
> +        // we want to remove all actions we added, especially those not owned by the document
> +        // (i.e. created on-the-fly during ContextMenuExtension::populateMenu with ownership
> +        // set to our addedContextMenu) but owned by the plugins

This can be made easier to understand:

`Handle the case we are being deleted while the context is not yet hidden.
We want to` [...]
Move the `but owned by the plugins` to before the explanation in parentheses.

> textdocument.cpp:244-249
> +        // the addedContextMenu owns actions created on-the-fly for the context menu
> +        // and thuse deletes them as well on destruction.
> +        // As some actions potentially could be connected to triggered-signal handlers
> +        // using Qt::QueuedConnection (at least SwitchToBuddyPlugin does so currently)
> +        // deleting them here also deletes the connection before the handler is triggered
> +        // so by default we delay the destruction to next eventloop as well

As above:

`// The addedContextMenu owns the actions` (it doesn't have any other actions, right?)
`// and thus deletes them on destruction` ("as well" doesn't really add anything here).

`// Some actions could potentially be connected` [...] `does so currently)`
`// Deleting them here would delete the connection` [...]
`// so we delay their destruction to the next eventloop by default.` (I don't see any other instances that are deleteLater'ed "as well").

REPOSITORY
  R32 KDevelop

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

To: kossebau, #kdevelop
Cc: rjvbb, kdevelop-devel, hmitonneau, christiant, glebaccon, domson, antismap, iodelay, alexeymin, geetamc, Pilzschaf, akshaydeo, surgenight, arrowd
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kdevelop-devel/attachments/20190713/ead1bf81/attachment-0001.html>


More information about the KDevelop-devel mailing list