aboutsummaryrefslogtreecommitdiffstats
path: root/e-util
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2009-06-26 23:05:58 +0800
committerMatthew Barnes <mbarnes@redhat.com>2009-06-26 23:05:58 +0800
commitce37d56d0b42f88549e45920df29a06fdce3ce95 (patch)
treea965088e5d68e76d0143fa84bf08efd8a8956942 /e-util
parentf0cf88bc99a458193f2c16a3ed346c20f6a5fd1a (diff)
downloadgsoc2013-evolution-ce37d56d0b42f88549e45920df29a06fdce3ce95.tar.gz
gsoc2013-evolution-ce37d56d0b42f88549e45920df29a06fdce3ce95.tar.zst
gsoc2013-evolution-ce37d56d0b42f88549e45920df29a06fdce3ce95.zip
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.
Diffstat (limited to 'e-util')
-rw-r--r--e-util/e-plugin-ui.c22
1 files changed, 14 insertions, 8 deletions
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 <ui-manager> */
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);
}