Search code examples
cdbusgio

D-Bus list name


How can I list all names in the D-Bus sessionBus with C?

I'm looking for the C GIO equivalent for the dbus.list_names python method

I want to list all names in «org.mpris.MediaPlayer2» which as example could be «org.mpris.MediaPlayer2.clementine, org.mpris.MediaPlayer2.someotherplayer, ...»

There is an application called «qdbusviewer» which does something similar


Solution

  • There is no specific GIO method for this tasks,

    Bus names can be listet with a call to the «org.freedesktop.DBus.ListNames», filtering has to be done later.

    Obtaining informations about the bus can be done with the introspection methods.