aboutsummaryrefslogtreecommitdiffstats
path: root/filter
diff options
context:
space:
mode:
authorHans Petter Jansson <hpj@ximian.com>2004-02-07 05:00:47 +0800
committerHans Petter <hansp@src.gnome.org>2004-02-07 05:00:47 +0800
commit08df2dcd198fb9680323315c7c290fd2b96787c6 (patch)
treecf9fcd6fdfe0bde30d6528a04ef815296c2dac70 /filter
parent0031585d9079e37f4b2793006a45aacbf65a3a46 (diff)
downloadgsoc2013-evolution-08df2dcd198fb9680323315c7c290fd2b96787c6.tar.gz
gsoc2013-evolution-08df2dcd198fb9680323315c7c290fd2b96787c6.tar.zst
gsoc2013-evolution-08df2dcd198fb9680323315c7c290fd2b96787c6.zip
Default to an empty string for the value. (xml_decode): Remove old values
2004-02-06 Hans Petter Jansson <hpj@ximian.com> * filter-input.c (filter_input_init): Default to an empty string for the value. (xml_decode): Remove old values before decoding the new ones. svn path=/trunk/; revision=24660
Diffstat (limited to 'filter')
-rw-r--r--filter/ChangeLog6
-rw-r--r--filter/filter-input.c19
2 files changed, 23 insertions, 2 deletions
diff --git a/filter/ChangeLog b/filter/ChangeLog
index be84519b79..7f631ac4d1 100644
--- a/filter/ChangeLog
+++ b/filter/ChangeLog
@@ -1,3 +1,9 @@
+2004-02-06 Hans Petter Jansson <hpj@ximian.com>
+
+ * filter-input.c (filter_input_init): Default to an empty string
+ for the value.
+ (xml_decode): Remove old values before decoding the new ones.
+
2004-02-03 Dan Winship <danw@ximian.com>
* Makefile.am (INCLUDES): add widgets/misc
diff --git a/filter/filter-input.c b/filter/filter-input.c
index a43156b802..ac2c59f610 100644
--- a/filter/filter-input.c
+++ b/filter/filter-input.c
@@ -35,7 +35,7 @@
#include "filter-input.h"
#include "e-util/e-sexp.h"
-#define d(x)
+#define d(x)
static gboolean validate (FilterElement *fe);
static int input_eq (FilterElement *fe, FilterElement *cm);
@@ -102,7 +102,7 @@ filter_input_class_init (FilterInputClass *klass)
static void
filter_input_init (FilterInput *fi)
{
- ;
+ fi->values = g_list_prepend (NULL, g_strdup (""));
}
static void
@@ -148,6 +148,8 @@ filter_input_set_value (FilterInput *fi, const char *value)
{
GList *l;
+ d(printf("set_value '%s'\n", value));
+
l = fi->values;
while (l) {
g_free (l->data);
@@ -269,7 +271,16 @@ xml_decode (FilterElement *fe, xmlNodePtr node)
FilterInput *fi = (FilterInput *)fe;
char *name, *str, *type;
xmlNodePtr n;
+ GList *l;
+ l = fi->values;
+ while (l) {
+ g_free (l->data);
+ l = l->next;
+ }
+ g_list_free (fi->values);
+ fi->values = NULL;
+
name = xmlGetProp (node, "name");
type = xmlGetProp (node, "type");
@@ -306,6 +317,8 @@ entry_changed (GtkEntry *entry, FilterElement *fe)
new = gtk_entry_get_text (entry);
+ d(printf("entry_changed '%s'\n", new));
+
/* NOTE: entry only supports a single value ... */
l = fi->values;
while (l) {
@@ -344,6 +357,8 @@ format_sexp (FilterElement *fe, GString *out)
{
FilterInput *fi = (FilterInput *) fe;
GList *l;
+
+ d(printf("format_sexp, first elem=%p\n", fi->values));
l = fi->values;
while (l) {