diff options
author | Ted Gould <ted@canonical.com> | 2009-04-16 17:19:51 -0500 |
---|---|---|
committer | Ted Gould <ted@canonical.com> | 2009-04-16 17:19:51 -0500 |
commit | 29e7e02e7f006cde4a5f142fe656ac6936fd6976 (patch) | |
tree | 374df3721a54c4c8222d94866446fb0d41db41d7 | |
parent | 907a7e88717a2f511fac3f0781ddf2aa0a767129 (diff) | |
download | libdbusmenu-29e7e02e7f006cde4a5f142fe656ac6936fd6976.tar.gz libdbusmenu-29e7e02e7f006cde4a5f142fe656ac6936fd6976.tar.bz2 libdbusmenu-29e7e02e7f006cde4a5f142fe656ac6936fd6976.zip |
A couple of debug strings and then making it so that if there is a root menu, it's at the root of the XML data instead of having a root wrapped around it.
-rw-r--r-- | libdbusmenu-glib/server.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/libdbusmenu-glib/server.c b/libdbusmenu-glib/server.c index cd2ab5c..13eb240 100644 --- a/libdbusmenu-glib/server.c +++ b/libdbusmenu-glib/server.c @@ -173,6 +173,7 @@ static void xmlarray_foreach_free (gpointer arrayentry, gpointer userdata) { if (arrayentry != NULL) { + /* g_debug("Freeing pointer: %s", (gchar *)arrayentry); */ g_free(arrayentry); } @@ -193,16 +194,17 @@ get_property (GObject * obj, guint id, GValue * value, GParamSpec * pspec) break; case PROP_LAYOUT: { GPtrArray * xmlarray = g_ptr_array_new(); - g_ptr_array_add(xmlarray, g_strdup("<menu>")); - if (priv->root != NULL) { + if (priv->root == NULL) { + g_ptr_array_add(xmlarray, g_strdup("<menu />")); + } else { dbusmenu_menuitem_buildxml(priv->root, xmlarray); } - g_ptr_array_add(xmlarray, g_strdup("</menu>")); g_ptr_array_add(xmlarray, NULL); /* build string */ - gchar * finalstring = g_strjoinv("\n", (gchar **)xmlarray->pdata); + gchar * finalstring = g_strjoinv("", (gchar **)xmlarray->pdata); g_value_take_string(value, finalstring); + /* g_debug("Final string: %s", finalstring); */ g_ptr_array_foreach(xmlarray, xmlarray_foreach_free, NULL); g_ptr_array_free(xmlarray, TRUE); |