Patch for the 'dbus' tool to group services

David Faure faure at kde.org
Wed Aug 23 16:57:15 BST 2006


The current output of dbus is a bit confusing because the same processes appear more than
once, when they have registered other names (aliases), which is the common case.

This patch groups together all names that correspond to the same process ("owner"),
in the output. I'm not sure if it's better to put them on the same line, separated with spaces,
or on different lines but indented under the owner? In any case that's a matter of using
" " or "\n " as the separator :)

For scripts which might parse the output of "dbus", I guess the "\n " solution is a bit
easier: grep can be done, just one space has to be removed if reusing one line as argument
later on. The result currently looks like this:

$ dbus
:1.148
 org.kde.kio_uiserver
:1.161
 org.kde.kded
:1.171
 org.kde.klauncher
 org.kde.klauncher_5494
:1.190
org.freedesktop.DBus

(where :1.190 is the dbus tool itself in this example)

PS: I just fixed kdbus to do a similar grouping.

-- 
David Faure, faure at kde.org, sponsored by Trolltech to work on KDE,
Konqueror (http://www.konqueror.org), and KOffice (http://www.koffice.org).
-------------- next part --------------
A non-text attachment was scrubbed...
Name: dbus.cpp.diff
Type: text/x-diff
Size: 1302 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20060823/6e156da2/attachment.diff>


More information about the kde-core-devel mailing list