<table><tr><td style="">kossebau created this revision.<br />kossebau added a reviewer: KDE Connect.<br />kossebau requested review of this revision.
</td><a style="text-decoration: none; padding: 4px 8px; margin: 0 8px 8px; float: right; color: #464C5C; font-weight: bold; border-radius: 3px; background-color: #F7F7F9; background-image: linear-gradient(to bottom,#fff,#f1f0f1); display: inline-block; border: 1px solid rgba(71,87,120,.2);" href="https://phabricator.kde.org/D11389">View Revision</a></tr></table><br /><div><strong>REVISION SUMMARY</strong><div><p>If MPRIS players were appearing and disappearing multiple times, the<br />
OrgFreedesktopDBusPropertiesInterface & OrgMprisMediaPlayer2PlayerInterface<br />
instances created for listening to the signals had been accumulating and<br />
thus resulting in X signals per X restarted player, because the instances<br />
were not deleted when a player disappeared.<br />
Additionally were instances of them created on the fly on the stack in<br />
some of the methods, instead of reusing the existing ones.</p>

<p>This patch changes that by introducing a class MprisPlayer which holds all<br />
data & instances per player. This allows to look up the respective<br />
interfaces instances to reuse them as well as properly controlling their<br />
lifetime.</p></div></div><br /><div><strong>TEST PLAN</strong><div><p>Starting and restarting multiple MPRIS players (incl. multiple instances of<br />
the same player app) works as expected as befire. They are listed on the<br />
Android Media control as well as have proper states there when selected.<br />
Additionally no longer multiple change signals are emitted if restarting a<br />
player.</p></div></div><br /><div><strong>REPOSITORY</strong><div><div>R224 KDE Connect</div></div></div><br /><div><strong>BRANCH</strong><div><div>donotaccumulaemprisinterfaces</div></div></div><br /><div><strong>REVISION DETAIL</strong><div><a href="https://phabricator.kde.org/D11389">https://phabricator.kde.org/D11389</a></div></div><br /><div><strong>AFFECTED FILES</strong><div><div>plugins/mpriscontrol/mpriscontrolplugin.cpp<br />
plugins/mpriscontrol/mpriscontrolplugin.h</div></div></div><br /><div><strong>To: </strong>kossebau, KDE Connect<br /></div>