D11389: MPRIS control: do not accumulate interface objects

Matthijs Tijink noreply at phabricator.kde.org
Fri Mar 16 17:43:11 UTC 2018


mtijink requested changes to this revision.
mtijink added a comment.
This revision now requires changes to proceed.


  Didn't test it yet, but it generally looks like a good patch!

INLINE COMMENTS

> mpriscontrolplugin.cpp:118
> +    auto end = playerList.constEnd();
> +    for (; it != end; ++it) {
> +        if (it.value().mediaPlayer2PlayerInterface == mediaPlayer2PlayerInterface) {

This loop can be replaced with `std::find_if` (also elsewhere in the code).

> mpriscontrolplugin.cpp:230
> +    MprisPlayer& player = it.value();
> +    delete player.propertiesInterface;
> +    delete player.mediaPlayer2PlayerInterface;

Instead of using raw `delete`s here, it's better to use `std::unique_ptr` (or a Qt equivalent?).

REPOSITORY
  R224 KDE Connect

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

To: kossebau, #kde_connect, mtijink
Cc: mtijink
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kdeconnect/attachments/20180316/47a0e691/attachment.html>


More information about the KDEConnect mailing list