[2.30] branch gnome-applets
[jhbuild/xnox.git] / patches / dbus-glib_ignore_namespaces.patch
blobdbd4e38d0dcc36e29be4d34b80e09607e52c4239
1 diff -up dbus-glib-0.73/dbus/dbus-gparser.c.ignore-namespaces dbus-glib-0.73/dbus/dbus-gparser.c
2 --- dbus-glib-0.73/dbus/dbus-gparser.c.ignore-namespaces 2006-09-27 08:27:24.000000000 -0400
3 +++ dbus-glib-0.73/dbus/dbus-gparser.c 2008-03-13 08:54:14.000000000 -0400
4 @@ -128,13 +128,17 @@ locate_attributes (const char *element_
6 if (!found)
8 - g_set_error (error,
9 - G_MARKUP_ERROR,
10 - G_MARKUP_ERROR_PARSE,
11 - _("Attribute \"%s\" is invalid on <%s> element in this context"),
12 - attribute_names[i], element_name);
13 - retval = FALSE;
14 - goto out;
15 + /* We want to passthrough namespaced XML nodes that we don't know anything about. */
16 + if (strchr (attribute_names[i], ':') == NULL)
17 + {
18 + g_set_error (error,
19 + G_MARKUP_ERROR,
20 + G_MARKUP_ERROR_PARSE,
21 + _("Attribute \"%s\" is invalid on <%s> element in this context"),
22 + attribute_names[i], element_name);
23 + retval = FALSE;
24 + goto out;
25 + }
28 ++i;
29 @@ -177,6 +181,7 @@ struct Parser
30 PropertyInfo *property;
31 ArgInfo *arg;
32 gboolean in_annotation;
33 + guint unknown_namespaced_depth;
36 Parser*
37 @@ -791,10 +796,14 @@ parser_start_element (Parser *parse
39 else
41 - g_set_error (error, G_MARKUP_ERROR,
42 - G_MARKUP_ERROR_PARSE,
43 - _("Element <%s> not recognized"),
44 - element_name);
45 + if (strchr (element_name, ':') != NULL)
46 + /* Passthrough XML-namespaced nodes */
47 + parser->unknown_namespaced_depth += 1;
48 + else if (parser->unknown_namespaced_depth == 0)
49 + g_set_error (error, G_MARKUP_ERROR,
50 + G_MARKUP_ERROR_PARSE,
51 + _("Element <%s> not recognized"),
52 + element_name);
55 return TRUE;
56 @@ -844,6 +853,15 @@ parser_end_element (Parser *parser,
57 if (parser->node_stack == NULL)
58 parser->result = top; /* We are done, store the result */
60 + else if (strchr (element_name, ':') != NULL)
61 + {
62 + /* Passthrough XML-namespaced nodes */
63 + parser->unknown_namespaced_depth -= 1;
64 + }
65 + else if (parser->unknown_namespaced_depth > 0)
66 + {
67 + /* pass through unknown elements underneath a namespace */
68 + }
69 else
70 g_assert_not_reached (); /* should have had an error on start_element */
72 diff -up dbus-glib-0.73/dbus/dbus-glib-tool.c.ignore-namespaces dbus-glib-0.73/dbus/dbus-glib-tool.c
73 --- dbus-glib-0.73/dbus/dbus-glib-tool.c.ignore-namespaces 2008-03-13 08:31:21.000000000 -0400
74 +++ dbus-glib-0.73/dbus/dbus-glib-tool.c 2008-03-13 08:32:15.000000000 -0400
75 @@ -414,7 +414,7 @@ main (int argc, char **argv)
76 &error);
77 if (node == NULL)
79 - lose_gerror (_("Unable to load \"%s\""), error);
80 + lose (_("Unable to load \"%s\": %s"), filename, error->message);
82 else