D11389: MPRIS control: do not accumulate interface objects
Friedrich W. H. Kossebau
noreply at phabricator.kde.org
Fri Mar 16 12:57:12 UTC 2018
kossebau created this revision.
kossebau added a reviewer: KDE Connect.
kossebau requested review of this revision.
REVISION SUMMARY
If MPRIS players were appearing and disappearing multiple times, the
OrgFreedesktopDBusPropertiesInterface & OrgMprisMediaPlayer2PlayerInterface
instances created for listening to the signals had been accumulating and
thus resulting in X signals per X restarted player, because the instances
were not deleted when a player disappeared.
Additionally were instances of them created on the fly on the stack in
some of the methods, instead of reusing the existing ones.
This patch changes that by introducing a class MprisPlayer which holds all
data & instances per player. This allows to look up the respective
interfaces instances to reuse them as well as properly controlling their
lifetime.
TEST PLAN
Starting and restarting multiple MPRIS players (incl. multiple instances of
the same player app) works as expected as befire. They are listed on the
Android Media control as well as have proper states there when selected.
Additionally no longer multiple change signals are emitted if restarting a
player.
REPOSITORY
R224 KDE Connect
BRANCH
donotaccumulaemprisinterfaces
REVISION DETAIL
https://phabricator.kde.org/D11389
AFFECTED FILES
plugins/mpriscontrol/mpriscontrolplugin.cpp
plugins/mpriscontrol/mpriscontrolplugin.h
To: kossebau, #kde_connect
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kdeconnect/attachments/20180316/392ba39f/attachment.html>
More information about the KDEConnect
mailing list