[Differential] [Commented On] 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:52:40 UTC 2016


davidedmundson added inline comments.

INLINE COMMENTS

> davidedmundson wrote in playercontainer.cpp:119
> 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();
>   }

Ninja edit.

If you do go with that approach don't use the code above.

Use 
secondaryInstancePid = QDBusConnectionInterface::servicePid(m_dbusAddress).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/f574e58b/attachment.html>


More information about the Plasma-devel mailing list