diff options
author | Not Zed <NotZed@Ximian.com> | 2001-03-01 08:52:51 +0800 |
---|---|---|
committer | Michael Zucci <zucchi@src.gnome.org> | 2001-03-01 08:52:51 +0800 |
commit | 1b995212bd98536449d763031654c410200dbdd0 (patch) | |
tree | 83267bedca5814f699f43aca45beb75aa858d138 | |
parent | 20143e0762f927d23f57d72928761e1f599bbad2 (diff) | |
download | gsoc2013-evolution-1b995212bd98536449d763031654c410200dbdd0.tar gsoc2013-evolution-1b995212bd98536449d763031654c410200dbdd0.tar.gz gsoc2013-evolution-1b995212bd98536449d763031654c410200dbdd0.tar.bz2 gsoc2013-evolution-1b995212bd98536449d763031654c410200dbdd0.tar.lz gsoc2013-evolution-1b995212bd98536449d763031654c410200dbdd0.tar.xz gsoc2013-evolution-1b995212bd98536449d763031654c410200dbdd0.tar.zst gsoc2013-evolution-1b995212bd98536449d763031654c410200dbdd0.zip |
New function to clone rules.
2001-02-28 Not Zed <NotZed@Ximian.com>
* filter-rule.c (filter_rule_clone): New function to clone rules.
svn path=/trunk/; revision=8435
-rw-r--r-- | filter/ChangeLog | 4 | ||||
-rw-r--r-- | filter/filter-rule.c | 15 | ||||
-rw-r--r-- | filter/filter-rule.h | 2 |
3 files changed, 21 insertions, 0 deletions
diff --git a/filter/ChangeLog b/filter/ChangeLog index c6de003925..382b815c4c 100644 --- a/filter/ChangeLog +++ b/filter/ChangeLog @@ -1,3 +1,7 @@ +2001-02-28 Not Zed <NotZed@Ximian.com> + + * filter-rule.c (filter_rule_clone): New function to clone rules. + 2001-02-23 Not Zed <NotZed@Ximian.com> * filtertypes.xml: Added mailing list matching rules. diff --git a/filter/filter-rule.c b/filter/filter-rule.c index 663e9d7f81..c5d36d3496 100644 --- a/filter/filter-rule.c +++ b/filter/filter-rule.c @@ -138,6 +138,21 @@ filter_rule_new () return o; } +FilterRule * +filter_rule_clone(FilterRule *base, RuleContext *f) +{ + xmlNodePtr xml; + FilterRule *rule; + + /* TODO: do this more directly/efficiently */ + xml = filter_rule_xml_encode(base); + rule = gtk_type_new(((GtkObject *)base)->klass->type); + filter_rule_xml_decode(rule, xml, f); + xmlFreeNodeList(xml); + + return rule; +} + void filter_rule_set_name (FilterRule *fr, const char *name) { diff --git a/filter/filter-rule.h b/filter/filter-rule.h index 8c6f9cf42b..3fc00fe598 100644 --- a/filter/filter-rule.h +++ b/filter/filter-rule.h @@ -73,6 +73,8 @@ struct _FilterRuleClass { guint filter_rule_get_type (void); FilterRule *filter_rule_new (void); +FilterRule *filter_rule_clone (FilterRule *base, struct _RuleContext *f); + /* methods */ void filter_rule_set_name (FilterRule *fr, const char *name); void filter_rule_set_source (FilterRule *fr, const char *source); |