aboutsummaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorTed Gould <ted@gould.cx>2010-06-28 11:07:31 -0500
committerTed Gould <ted@gould.cx>2010-06-28 11:07:31 -0500
commite7ef77f7498d95f1f752aaca73f2dfdd935a0f44 (patch)
treece1dfafdc7fec6e192a0c0789fd5802ca5e29914 /tools
parent62b0fccd725b4e3c7b01e39258fd64dfa1d6064d (diff)
downloadlibdbusmenu-e7ef77f7498d95f1f752aaca73f2dfdd935a0f44.tar.gz
libdbusmenu-e7ef77f7498d95f1f752aaca73f2dfdd935a0f44.tar.bz2
libdbusmenu-e7ef77f7498d95f1f752aaca73f2dfdd935a0f44.zip
Splitting out the collection printing.
Diffstat (limited to 'tools')
-rw-r--r--tools/dbusmenu-dumper.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/tools/dbusmenu-dumper.c b/tools/dbusmenu-dumper.c
index 68a21d9..38284b1 100644
--- a/tools/dbusmenu-dumper.c
+++ b/tools/dbusmenu-dumper.c
@@ -25,8 +25,16 @@ with this program. If not, see <http://www.gnu.org/licenses/>.
#include <libdbusmenu-glib/client.h>
#include <libdbusmenu-glib/menuitem.h>
+#include <dbus/dbus-gtype-specialized.h>
+
static GMainLoop * mainloop = NULL;
+static gchar *
+collection_dumper (const GValue * value)
+{
+ return g_strdup("<collection>");
+}
+
static void
print_menuitem (DbusmenuMenuitem * item, int depth)
{
@@ -37,7 +45,12 @@ print_menuitem (DbusmenuMenuitem * item, int depth)
GList * property;
for (property = properties; property != NULL; property = g_list_next(property)) {
const GValue * value = dbusmenu_menuitem_property_get_value(item, (gchar *)property->data);
- gchar * str = g_strdup_value_contents(value);
+ gchar * str = NULL;
+ if (dbus_g_type_is_collection(G_VALUE_TYPE(value))) {
+ str = collection_dumper(value);
+ } else {
+ str = g_strdup_value_contents(value);
+ }
g_print(",\n%s\"%s\": %s", space, (gchar *)property->data, str);
g_free(str);
}