From 00a8f5e2ec693222e02e96c700c235a81eeb4ce5 Mon Sep 17 00:00:00 2001 From: Jeffrey Stedfast Date: Thu, 25 Jul 2002 08:49:56 +0000 Subject: [PATCH] Use GtkType (I only changed this one because I turned on debugging for a 2002-07-25 Jeffrey Stedfast * filter-int.[c,h]: Use GtkType (I only changed this one because I turned on debugging for a bit). * filter-file.c (validate): Fix the strcmp logic a bit, I had it the exact opposite of what I really wanted. Oops :-) svn path=/trunk/; revision=17586 --- filter/ChangeLog | 8 ++++++++ filter/filter-file.c | 7 ++++--- filter/filter-int.c | 10 +++++++--- filter/filter-int.h | 2 +- filter/filter-rule.c | 4 ++++ 5 files changed, 24 insertions(+), 7 deletions(-) diff --git a/filter/ChangeLog b/filter/ChangeLog index 95b02e0d4f..ffdeedd65c 100644 --- a/filter/ChangeLog +++ b/filter/ChangeLog @@ -1,3 +1,11 @@ +2002-07-25 Jeffrey Stedfast + + * filter-int.[c,h]: Use GtkType (I only changed this one because I + turned on debugging for a bit). + + * filter-file.c (validate): Fix the strcmp logic a bit, I had it + the exact opposite of what I really wanted. Oops :-) + 2002-07-25 Jeffrey Stedfast * filter-file.c (validate): Do some minimalistic validation of diff --git a/filter/filter-file.c b/filter/filter-file.c index 14f8e04d5b..4b4eb69904 100644 --- a/filter/filter-file.c +++ b/filter/filter-file.c @@ -41,7 +41,7 @@ #include "filter-file.h" #include "e-util/e-sexp.h" -#define d(x) +#define d(x) static gboolean validate (FilterElement *fe); static int file_eq(FilterElement *fe, FilterElement *cm); @@ -183,7 +183,7 @@ validate (FilterElement *fe) /* FIXME: do more to validate command-lines? */ - if (strcmp (file->type, "file") != 0) { + if (strcmp (file->type, "file") == 0) { if (stat (file->path, &st) == -1 || !S_ISREG (st.st_mode)) { char *errmsg; @@ -195,7 +195,7 @@ validate (FilterElement *fe) gnome_dialog_run_and_close (GNOME_DIALOG (dialog)); return FALSE; } - } else if (strcmp (file->type, "command") != 0) { + } else if (strcmp (file->type, "command") == 0) { /* only requirements so far is that the command can't be an empty string */ return file->path[0] != '\0'; @@ -270,6 +270,7 @@ xml_decode (FilterElement *fe, xmlNodePtr node) str = xmlNodeGetContent (n); if (str) { + decstr = e_utf8_xml1_decode (str); xmlFree (str); } else diff --git a/filter/filter-int.c b/filter/filter-int.c index a92b0b1b2b..d7225a9bda 100644 --- a/filter/filter-int.c +++ b/filter/filter-int.c @@ -57,10 +57,10 @@ enum { static guint signals[LAST_SIGNAL] = { 0 }; -guint +GtkType filter_int_get_type (void) { - static guint type = 0; + static GtkType type = 0; if (!type) { GtkTypeInfo type_info = { @@ -203,16 +203,20 @@ xml_decode (FilterElement *fe, xmlNodePtr node) fe->name = name; type = xmlGetProp(node, "type"); + d(printf ("Type = %s\n", type)); g_free(fs->type); fs->type = g_strdup(type); xmlFree(type); intval = xmlGetProp (node, type?type:"integer"); if (intval) { + d(printf ("Value = %s\n", intval)); fs->val = atoi (intval); xmlFree (intval); - } else + } else { + d(printf ("Value = ?unknown?\n")); fs->val = 0; + } return 0; } diff --git a/filter/filter-int.h b/filter/filter-int.h index 4ed508cd36..f8cd2711c6 100644 --- a/filter/filter-int.h +++ b/filter/filter-int.h @@ -52,7 +52,7 @@ struct _FilterIntClass { /* signals */ }; -guint filter_int_get_type (void); +GtkType filter_int_get_type (void); FilterInt *filter_int_new (void); FilterInt *filter_int_new_type(const char *type, int min, int max); void filter_int_set_value(FilterInt *fi, int val); diff --git a/filter/filter-rule.c b/filter/filter-rule.c index 4adffeaf3c..9d796a1108 100644 --- a/filter/filter-rule.c +++ b/filter/filter-rule.c @@ -19,7 +19,11 @@ * Boston, MA 02111-1307, USA. */ + +#ifdef HAVE_CONFIG_H #include +#endif + #include #include #include