[Differential] [Changed Subscribers] D3667: [MPRIS Dataengine] Let clients distinguish media players by process id more easily

davidedmundson (David Edmundson) noreply at phabricator.kde.org
Tue Dec 13 18:44:21 UTC 2016


davidedmundson added inline comments.

INLINE COMMENTS

> playercontainer.cpp:119
> +    // at the end of its dbus address. This code bit sets "SecondaryInstancePid" to
> +    // <pid> in this case, otherwise it defaults to -1 (for the first one or players
> +    // which don't implement the standard correctly (looking at you VLC [v2.2.2]!)

There is a way to do it which will work for all players much more reliably:

  auto message = QDBusMessage::createMethodCall("org.freedesktop.DBus", "/", "org.freedesktop.DBus", "GetConnectionUnixProcessID");
  message.setArguments({m_dbusAddress});
  
  QDBusReply<uint> reply = QDBusConnection::sessionBus().call(message); 

//safe to be blocking as we're calling a method on DBus server not a client, so no different from QDBusConnection::connect()

   if (!reply.isError) {
     secondaryInstancePid = reply.value();
  }

REPOSITORY
  R120 Plasma Workspace

REVISION DETAIL
  https://phabricator.kde.org/D3667

EMAIL PREFERENCES
  https://phabricator.kde.org/settings/panel/emailpreferences/

To: subdiff, #plasma
Cc: davidedmundson, broulik, plasma-devel, lesliezhai, ali-mohamed, jensreuterberg, abetts, sebas
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/plasma-devel/attachments/20161213/72b3f9a6/attachment.html>


More information about the Plasma-devel mailing list