[mpris] [RFC] MPRIS2 Release Candidate
Alex Merry
kde at randomguy3.me.uk
Wed Aug 11 23:16:57 CEST 2010
On 10/08/10 20:15, Ian Monroe wrote:
> These sound like good reasons to never use PropertiesChanged.
Code to send a PropertiesChanged signal in Qt:
QDBusMessage signal =
QDBusMessage::createSignal("/org/mpris/MediaPlayer/Player",
"org.freedesktop.DBus.Properties", "PropertiesChanged");
signal << "org.mpris.MediaPlayer2.Player";
QVariantMap changedProps;
changedProps.insert("blah", "foo");
changedProps.insert("jim", 4);
changedProps.insert("rac", true);
signal << changedProps;
QStringList invalidatedProps;
invalidatedProps << "prop1" << "prop2";
signal << invalidatedProps;
QDBusConnection::sessionBus().send(signal);
Code to watch for a PropertiesChanged signal in Qt:
QDBusConnection::sessionBus().connect(
"org.mpris.mediaplayers.foo",
"/org/mpris/MediaPlayer/Player",
"org.freedesktop.DBus.Properties",
"PropertiesChanged",
this,
SLOT(propertiesChanged(QString,QVariantMap,QStringList)));
It works as a stopgap until QDBus is fixed to do this automagically (4.8?).
The only issue is that Qt won't expose this in the introspection data
for the org.freedesktop.DBus.Properties interface.
Alex
More information about the mpris
mailing list