[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    [kdeconnect-kde/0.9] plugins/mpriscontrol: Improvise a name for a player if the mpris interface does
From:       Albert Vaca <albertvaka () gmail ! com>
Date:       2015-11-11 19:23:14
Message-ID: E1ZwazC-0004Jt-UU () scm ! kde ! org
[Download RAW message or body]

Git commit cbc4cc5fd783eb0e42655bcf73388c366ca79711 by Albert Vaca.
Committed on 11/11/2015 at 19:00.
Pushed by albertvaka into branch '0.9'.

Improvise a name for a player if the mpris interface doesn't provide one

M  +4    -1    plugins/mpriscontrol/mpriscontrolplugin.cpp

http://commits.kde.org/kdeconnect-kde/cbc4cc5fd783eb0e42655bcf73388c366ca79711

diff --git a/plugins/mpriscontrol/mpriscontrolplugin.cpp b/plugins/mpriscontrol/mpriscontrolplugin.cpp
index 64d6b40..8f45356 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();

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic