qdbus

As an addendum to my comparison between DCOP and D-Bus, I recently discovered that Qt 4 apparently ships with a qdbus utility that acts like the command-line dcop utility, but using D-Bus. (I say “apparently” because Debian ships it as part of the libqt4-core package.)

For example, invoking a method:

$ qdbus org.gnome.Rhythmbox /org/gnome/Rhythmbox/Player getPlayingUri
file:///home/paul/music/Jonathon%20Coulton/Chiron%20Beta%20Prime.mp3

Or, listing the methods and signals available on an object (and ignoring the obvious instances of word wrapping below):

$ qdbus org.gnome.Rhythmbox /org/gnome/Rhythmbox/Player
method QString org.freedesktop.DBus.Introspectable.Introspect()
method QDBusVariant org.freedesktop.DBus.Properties.Get(QString interface, QString propname)
method void org.freedesktop.DBus.Properties.Set(QString interface, QString propname, QDBusVariant value)
signal void org.gnome.Rhythmbox.Player.elapsedChanged(uint)
method uint org.gnome.Rhythmbox.Player.getElapsed()
method bool org.gnome.Rhythmbox.Player.getMute()
method bool org.gnome.Rhythmbox.Player.getPlaying()
method QString org.gnome.Rhythmbox.Player.getPlayingUri()
method double org.gnome.Rhythmbox.Player.getVolume()
method void org.gnome.Rhythmbox.Player.next()
method void org.gnome.Rhythmbox.Player.playPause(bool arg0)
signal void org.gnome.Rhythmbox.Player.playingChanged(bool)
signal void org.gnome.Rhythmbox.Player.playingSongPropertyChanged(QString, QString, QDBusVariant, QDBusVariant)
signal void org.gnome.Rhythmbox.Player.playingUriChanged(QString)
method void org.gnome.Rhythmbox.Player.previous()
method void org.gnome.Rhythmbox.Player.setElapsed(uint elapsed)
method void org.gnome.Rhythmbox.Player.setMute(bool mute)
method void org.gnome.Rhythmbox.Player.setVolume(double volume)
method void org.gnome.Rhythmbox.Player.setVolumeRelative(double volume)

Maybe qdbus doesn’t have as many knobs to fiddle with as dbus-send, but in the common case it’s much more convenient.

One Response

  1. You know what, its questionably related, and maybe I’m pushing the envelope here:

    Kulinibox!

Comments are closed.