From ce37d56d0b42f88549e45920df29a06fdce3ce95 Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Fri, 26 Jun 2009 11:05:58 -0400 Subject: Get the "mail-to-task" plugin working again. This one was more challenging. It exposed some flaws in the new shell design and in EPluginUI, which is good because they're fixed now. --- e-util/e-plugin-ui.c | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) (limited to 'e-util/e-plugin-ui.c') diff --git a/e-util/e-plugin-ui.c b/e-util/e-plugin-ui.c index 2331af0f63..4f948fbb2f 100644 --- a/e-util/e-plugin-ui.c +++ b/e-util/e-plugin-ui.c @@ -375,10 +375,13 @@ plugin_ui_hook_construct (EPluginHook *hook, /* Chain up to parent's construct() method. */ E_PLUGIN_HOOK_CLASS (parent_class)->construct (hook, plugin, node); - for (node = node->children; node != NULL; node = node->next) { + for (node = xmlFirstElementChild (node); node != NULL; + node = xmlNextElementSibling (node)) { + xmlNodePtr child; xmlBufferPtr buffer; - const gchar *content; + GString *content; + const gchar *temp; gchar *id; if (strcmp ((gchar *) node->name, "ui-manager") != 0) @@ -390,18 +393,21 @@ plugin_ui_hook_construct (EPluginHook *hook, continue; } + content = g_string_sized_new (1024); + /* Extract the XML content below */ buffer = xmlBufferCreate (); - child = node->children; - while (child != NULL && xmlNodeIsText (child)) - child = child->next; - if (child != NULL) + for (child = xmlFirstElementChild (node); child != NULL; + child = xmlNextElementSibling (child)) { + xmlNodeDump (buffer, node->doc, child, 2, 1); - content = (const gchar *) xmlBufferContent (buffer); + temp = (const gchar *) xmlBufferContent (buffer); + g_string_append (content, temp); + } g_hash_table_insert ( priv->ui_definitions, - id, g_strdup (content)); + id, g_string_free (content, FALSE)); xmlBufferFree (buffer); } -- cgit v1.2.3