Don't barf on XML comments in background files

Don't print "Unknown tag" warnings when XML comments are encountered
in a wallpaper file (bug #588497).
This commit is contained in:
Jens Granseuer 2009-07-26 14:49:14 +02:00
parent 3e3e8ff02f
commit 9985e70d35

View file

@ -126,7 +126,9 @@ static void gnome_wp_xml_load_xml (AppearanceData *data,
wp->deleted = gnome_wp_xml_get_bool (list, "deleted");
for (wpa = list->children; wpa != NULL; wpa = wpa->next) {
if (!strcmp ((gchar *)wpa->name, "filename")) {
if (wpa->type == XML_COMMENT_NODE) {
continue;
} else if (!strcmp ((gchar *)wpa->name, "filename")) {
if (wpa->last != NULL && wpa->last->content != NULL) {
const char * none = "(none)";
gchar *content = g_strstrip ((gchar *)wpa->last->content);
@ -182,7 +184,7 @@ static void gnome_wp_xml_load_xml (AppearanceData *data,
} else if (!strcmp ((gchar *)wpa->name, "text")) {
/* Do nothing here, libxml2 is being weird */
} else {
g_warning ("Unknown Tag: %s\n", wpa->name);
g_warning ("Unknown Tag: %s", wpa->name);
}
}