From cbc4cc5fd783eb0e42655bcf73388c366ca79711 Mon Sep 17 00:00:00 2001 From: Albert Vaca Date: Wed, 11 Nov 2015 11:00:59 -0800 Subject: [PATCH] Improvise a name for a player if the mpris interface doesn't provide one --- plugins/mpriscontrol/mpriscontrolplugin.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/plugins/mpriscontrol/mpriscontrolplugin.cpp b/plugins/mpriscontrol/mpriscontrolplugin.cpp index 64d6b40d1..8f453567a 100644 --- a/plugins/mpriscontrol/mpriscontrolplugin.cpp +++ b/plugins/mpriscontrol/mpriscontrolplugin.cpp @@ -73,7 +73,10 @@ void MprisControlPlugin::addPlayer(const QString& service) { QDBusInterface mprisInterface(service, "/org/mpris/MediaPlayer2", "org.mpris.MediaPlayer2"); //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; qCDebug(KDECONNECT_PLUGIN_MPRIS) << "Mpris addPlayer" << service << "->" << identity; sendPlayerList();