aboutsummaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorTed Gould <ted@gould.cx>2010-06-28 11:55:22 -0500
committerTed Gould <ted@gould.cx>2010-06-28 11:55:22 -0500
commitaea8d2664195b8d5b6b77817a70c5955f9f32a8c (patch)
tree433b4af52a35ce66c5532b4cd929ba836ba0be8f /tools
parent057503a47f2dff7ea4863ffc1df939556cc1753f (diff)
downloadlibdbusmenu-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.c10
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;