aboutsummaryrefslogtreecommitdiffstats
path: root/filter
diff options
context:
space:
mode:
authorJeffrey Stedfast <fejj@ximian.com>2003-03-27 04:28:54 +0800
committerJeffrey Stedfast <fejj@src.gnome.org>2003-03-27 04:28:54 +0800
commit4d4d2a9114f5c5dd1286a8388ffc51ee73629040 (patch)
treef35e7e4bfe4551a2ee8042b185340522f7498597 /filter
parent7ecd4e666490ee384122b938149ac04ab8ead6d9 (diff)
downloadgsoc2013-evolution-4d4d2a9114f5c5dd1286a8388ffc51ee73629040.tar
gsoc2013-evolution-4d4d2a9114f5c5dd1286a8388ffc51ee73629040.tar.gz
gsoc2013-evolution-4d4d2a9114f5c5dd1286a8388ffc51ee73629040.tar.bz2
gsoc2013-evolution-4d4d2a9114f5c5dd1286a8388ffc51ee73629040.tar.lz
gsoc2013-evolution-4d4d2a9114f5c5dd1286a8388ffc51ee73629040.tar.xz
gsoc2013-evolution-4d4d2a9114f5c5dd1286a8388ffc51ee73629040.tar.zst
gsoc2013-evolution-4d4d2a9114f5c5dd1286a8388ffc51ee73629040.zip
Loop over child nodes here too in order to not be affected by libxml2
2003-03-26 Jeffrey Stedfast <fejj@ximian.com> * filter-file.c (xml_decode): Loop over child nodes here too in order to not be affected by libxml2 crack. * filter-source.c (xml_decode): Fixed to disreguard libxml2 crack. (get_widget): Use strcmp instead of e_url_equal(). svn path=/trunk/; revision=20523
Diffstat (limited to 'filter')
-rw-r--r--filter/ChangeLog8
-rw-r--r--filter/filter-file.c23
-rw-r--r--filter/filter-source.c25
3 files changed, 36 insertions, 20 deletions
diff --git a/filter/ChangeLog b/filter/ChangeLog
index a16abd676b..4fdd9b81e2 100644
--- a/filter/ChangeLog
+++ b/filter/ChangeLog
@@ -1,3 +1,11 @@
+2003-03-26 Jeffrey Stedfast <fejj@ximian.com>
+
+ * filter-file.c (xml_decode): Loop over child nodes here too in
+ order to not be affected by libxml2 crack.
+
+ * filter-source.c (xml_decode): Fixed to disreguard libxml2 crack.
+ (get_widget): Use strcmp instead of e_url_equal().
+
2003-03-20 Dan Winship <danw@ximian.com>
* filter-datespec.c (timespans, set_button): Change the strings in
diff --git a/filter/filter-file.c b/filter/filter-file.c
index 265f0855dd..7d33e025d9 100644
--- a/filter/filter-file.c
+++ b/filter/filter-file.c
@@ -257,16 +257,21 @@ xml_decode (FilterElement *fe, xmlNodePtr node)
file->type = type;
n = node->children;
- if (!strcmp (n->name, type)) {
- str = xmlNodeGetContent (n);
- if (str)
- file->path = g_strdup (str);
- else
- file->path = g_strdup ("");
+ while (n != NULL) {
+ if (!strcmp (n->name, type)) {
+ str = xmlNodeGetContent (n);
+ if (str)
+ file->path = g_strdup (str);
+ else
+ file->path = g_strdup ("");
+
+ d(printf (" '%s'\n", file->path));
+ break;
+ } else if (n->type == XML_ELEMENT_NODE) {
+ g_warning ("Unknown node type '%s' encountered decoding a %s\n", n->name, type);
+ }
- d(printf (" '%s'\n", file->path));
- } else if (n->type == XML_ELEMENT_NODE) {
- g_warning ("Unknown node type '%s' encountered decoding a %s\n", n->name, type);
+ n = n->next;
}
return 0;
diff --git a/filter/filter-source.c b/filter/filter-source.c
index faa51e8f58..365403bdf2 100644
--- a/filter/filter-source.c
+++ b/filter/filter-source.c
@@ -195,14 +195,19 @@ xml_decode (FilterElement *fe, xmlNodePtr node)
char *uri;
node = node->children;
- if (node && node->name && !strcmp (node->name, "uri")) {
- uri = xmlNodeGetContent (node);
- url = camel_url_new (uri, NULL);
- xmlFree (uri);
+ while (node != NULL) {
+ if (!strcmp (node->name, "uri")) {
+ uri = xmlNodeGetContent (node);
+ url = camel_url_new (uri, NULL);
+ xmlFree (uri);
+
+ g_free (fs->priv->current_url);
+ fs->priv->current_url = camel_url_to_string (url, CAMEL_URL_HIDE_ALL);
+ camel_url_free (url);
+ break;
+ }
- g_free (fs->priv->current_url);
- fs->priv->current_url = camel_url_to_string (url, CAMEL_URL_HIDE_ALL);
- camel_url_free (url);
+ node = node->next;
}
return 0;
@@ -275,13 +280,11 @@ get_widget (FilterElement *fe)
g_object_set_data ((GObject *) item, "source", info);
g_signal_connect (item, "activate", G_CALLBACK (source_changed), fs);
- gtk_menu_shell_append(GTK_MENU_SHELL(menu), item);
+ gtk_menu_shell_append (GTK_MENU_SHELL (menu), item);
gtk_widget_show (item);
- /* FIXME: don't use e_url_equal */
- if (fs->priv->current_url && e_url_equal (info->url, fs->priv->current_url)) {
+ if (fs->priv->current_url && !strcmp (info->url, fs->priv->current_url))
current_index = index;
- }
index++;
}