diff options
author | Not Zed <NotZed@Ximian.com> | 2002-07-15 09:46:17 +0800 |
---|---|---|
committer | Michael Zucci <zucchi@src.gnome.org> | 2002-07-15 09:46:17 +0800 |
commit | 68ec840bca073bc8e8ea2f58ad36078df9c619c1 (patch) | |
tree | 64083ad8df8983d37c2658c51e1c961e4671f160 /filter/filter-part.c | |
parent | e785008af08bdc913ce2711dcd7998efb51f694b (diff) | |
download | gsoc2013-evolution-68ec840bca073bc8e8ea2f58ad36078df9c619c1.tar.gz gsoc2013-evolution-68ec840bca073bc8e8ea2f58ad36078df9c619c1.tar.zst gsoc2013-evolution-68ec840bca073bc8e8ea2f58ad36078df9c619c1.zip |
** fixes for #10781
2002-07-10 Not Zed <NotZed@Ximian.com>
** fixes for #10781
* filter-int.c (xml_encode):
(xml_decode): Handle encoding/decoding with a type name, in a
manner compatible with the score/label elemtns.
(filter_int_new_type): New constructor to create a generic 'int'
type.
* filter-score.c: Removed. Now relies on using a filter-int with
appropriate settings.
* filter-label.[ch]: Now inherits from filter-int.
* rule-context.c (rule_context_revert): New method to revert a
filter context back to a user-file's definition.
(revert): implementation.
* filter-rule.h: Added new virtual method _eq and wrapper, and
fixed all subclasses to implement it.
* filter-element.h: Added new virtual method _eq and wrapper.
Fixed all subclasses to implement it.
svn path=/trunk/; revision=17448
Diffstat (limited to 'filter/filter-part.c')
-rw-r--r-- | filter/filter-part.c | 29 |
1 files changed, 28 insertions, 1 deletions
diff --git a/filter/filter-part.c b/filter/filter-part.c index e92c42aafb..3f05341c81 100644 --- a/filter/filter-part.c +++ b/filter/filter-part.c @@ -153,10 +153,37 @@ filter_part_validate (FilterPart *fp) } int +filter_part_eq(FilterPart *fp, FilterPart *fc) +{ + int truth; + GList *al, *bl; + + truth = ((fp->name && fc->name && strcmp(fp->name, fc->name) == 0) + || (fp->name == NULL && fc->name == NULL)) + && ((fp->title && fc->title && strcmp(fp->title, fc->title) == 0) + || (fp->title == NULL && fc->title == NULL)) + && ((fp->code && fc->code && strcmp(fp->code, fc->code) == 0) + || (fp->code == NULL && fc->code == NULL)); + + al = fp->elements; + bl = fc->elements; + while (truth && al && bl) { + FilterElement *a = al->data, *b = bl->data; + + truth = filter_element_eq(a, b); + + al = al->next; + bl = bl->next; + } + + return truth && al == NULL && bl == NULL; +} + +int filter_part_xml_create (FilterPart *ff, xmlNodePtr node) { xmlNodePtr n; - char *type, *str, *decstr; + char *type, *str; FilterElement *el; str = xmlGetProp(node, "name"); |