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-option.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-option.c')
-rw-r--r-- | filter/filter-option.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/filter/filter-option.c b/filter/filter-option.c index b0e1abc3d0..4102cd5eaf 100644 --- a/filter/filter-option.c +++ b/filter/filter-option.c @@ -34,6 +34,7 @@ #define d(x) +static int option_eq(FilterElement *fe, FilterElement *cm); static void xml_create(FilterElement *fe, xmlNodePtr node); static xmlNodePtr xml_encode(FilterElement *fe); static int xml_decode(FilterElement *fe, xmlNodePtr node); @@ -93,6 +94,7 @@ filter_option_class_init (FilterOptionClass *class) object_class->finalize = filter_option_finalise; /* override methods */ + filter_element->eq = option_eq; filter_element->xml_create = xml_create; filter_element->xml_encode = xml_encode; filter_element->xml_decode = xml_decode; @@ -171,6 +173,16 @@ filter_option_set_current (FilterOption *option, const char *name) option->current = find_option (option, name); } +static int +option_eq(FilterElement *fe, FilterElement *cm) +{ + FilterOption *fo = (FilterOption *)fe, *co = (FilterOption *)cm; + + return ((FilterElementClass *)(parent_class))->eq(fe, cm) + && ((fo->current && co->current && strcmp(fo->current->value, co->current->value) == 0) + || (fo->current == NULL && co->current == NULL)); +} + static void xml_create (FilterElement *fe, xmlNodePtr node) { |