diff options
author | Ted Gould <ted@gould.cx> | 2010-06-28 11:55:22 -0500 |
---|---|---|
committer | Ted Gould <ted@gould.cx> | 2010-06-28 11:55:22 -0500 |
commit | aea8d2664195b8d5b6b77817a70c5955f9f32a8c (patch) | |
tree | 433b4af52a35ce66c5532b4cd929ba836ba0be8f /tools | |
parent | 057503a47f2dff7ea4863ffc1df939556cc1753f (diff) | |
download | libdbusmenu-aea8d2664195b8d5b6b77817a70c5955f9f32a8c.tar.gz libdbusmenu-aea8d2664195b8d5b6b77817a70c5955f9f32a8c.tar.bz2 libdbusmenu-aea8d2664195b8d5b6b77817a70c5955f9f32a8c.zip |
Optimizing the one item in the collection case (common for shortcuts)
Diffstat (limited to 'tools')
-rw-r--r-- | tools/dbusmenu-dumper.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/tools/dbusmenu-dumper.c b/tools/dbusmenu-dumper.c index 6af344d..f0f4ba0 100644 --- a/tools/dbusmenu-dumper.c +++ b/tools/dbusmenu-dumper.c @@ -90,8 +90,14 @@ collection_dumper (const GValue * value, int depth) g_ptr_array_add(array, g_strdup_printf("\n%s]", space)); g_free(space); - - gchar * retstr = g_strjoinv(NULL, (gchar **)array->pdata); + + gchar * retstr = NULL; + if (array->len == 3) { + retstr = g_strdup_printf("[%s]", ((gchar *)array->pdata[1]) + depth + 1/*for newline*/); + } else { + retstr = g_strjoinv(NULL, (gchar **)array->pdata); + } + g_ptr_array_free(array, TRUE); return retstr; |