aboutsummaryrefslogtreecommitdiffstats
path: root/filter/filter-part.c
diff options
context:
space:
mode:
authorJeffrey Stedfast <fejj@helixcode.com>2000-10-31 11:43:26 +0800
committerJeffrey Stedfast <fejj@src.gnome.org>2000-10-31 11:43:26 +0800
commit0eb24eaa396b7f5f3ebe6fab21080cda7ba7d4bc (patch)
treed3a41d97055a1a92aa804201dacef5385c062c48 /filter/filter-part.c
parent7c3fad23b7c212cc96606a44e81d43e65b85acf8 (diff)
downloadgsoc2013-evolution-0eb24eaa396b7f5f3ebe6fab21080cda7ba7d4bc.tar.gz
gsoc2013-evolution-0eb24eaa396b7f5f3ebe6fab21080cda7ba7d4bc.tar.zst
gsoc2013-evolution-0eb24eaa396b7f5f3ebe6fab21080cda7ba7d4bc.zip
If a regex option is selected, change the FilterElement data to TRUE else
2000-10-30 Jeffrey Stedfast <fejj@helixcode.com> * filter-option.c (option_activate): If a regex option is selected, change the FilterElement data to TRUE else set to FALSE. * filter-rule.c (more_parts): Validate the previously entered FilterPart before allowing the user to add a new FilterPart. * filter-part.c (filter_part_validate): New convenience function to validate an entire FilterPart expression. * filter-input.c (validate): Validate the entry text if it contains a regular expression. * filter-element.[c,h]: New virtual function to validate the contents of the FilterElement (useful for regex and sexp). (filter_element_validate): You get the idea... svn path=/trunk/; revision=6285
Diffstat (limited to 'filter/filter-part.c')
-rw-r--r--filter/filter-part.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/filter/filter-part.c b/filter/filter-part.c
index a467a0c3c0..f32ed517c7 100644
--- a/filter/filter-part.c
+++ b/filter/filter-part.c
@@ -113,6 +113,25 @@ filter_part_new (void)
return o;
}
+gboolean
+filter_part_validate (FilterPart *fp)
+{
+ gboolean correct = TRUE;
+ FilterElement *last = NULL;
+ GList *l;
+
+ l = fp->elements;
+ while (l && correct) {
+ FilterElement *fe = l->data;
+
+ correct = filter_element_validate (fe, last ? last->data : NULL);
+
+ last = fe;
+ l = l->next;
+ }
+
+ return correct;
+}
int
filter_part_xml_create (FilterPart *ff, xmlNodePtr node)