Improvise a name for a player if the mpris interface doesn't provide one
This commit is contained in:
parent
04d52fb022
commit
cbc4cc5fd7
1 changed files with 4 additions and 1 deletions
|
@ -73,7 +73,10 @@ void MprisControlPlugin::addPlayer(const QString& service)
|
||||||
{
|
{
|
||||||
QDBusInterface mprisInterface(service, "/org/mpris/MediaPlayer2", "org.mpris.MediaPlayer2");
|
QDBusInterface mprisInterface(service, "/org/mpris/MediaPlayer2", "org.mpris.MediaPlayer2");
|
||||||
//FIXME: This call hangs and returns an empty string if KDED is still starting!
|
//FIXME: This call hangs and returns an empty string if KDED is still starting!
|
||||||
const QString identity = mprisInterface.property("Identity").toString();
|
QString identity = mprisInterface.property("Identity").toString();
|
||||||
|
if (identity.isEmpty()) {
|
||||||
|
identity = service.mid(sizeof("org.mpris.MediaPlayer2"));
|
||||||
|
}
|
||||||
playerList[identity] = service;
|
playerList[identity] = service;
|
||||||
qCDebug(KDECONNECT_PLUGIN_MPRIS) << "Mpris addPlayer" << service << "->" << identity;
|
qCDebug(KDECONNECT_PLUGIN_MPRIS) << "Mpris addPlayer" << service << "->" << identity;
|
||||||
sendPlayerList();
|
sendPlayerList();
|
||||||
|
|
Loading…
Reference in a new issue