From 9ddabfee03542411d02851a1b1f144707ce32b82 Mon Sep 17 00:00:00 2001 From: Not Zed Date: Mon, 31 Jul 2000 15:03:23 +0000 Subject: Set value of a simple type to a new string. 2000-07-31 Not Zed * filter-input.c (filter_input_set_value): Set value of a simple type to a new string. * filter-option.c (filter_option_set_current): New function to set the current value of an option. * filter-rule.c (filter_rule_find_list): New function to find a rule in a list, by name. (filter_rule_set_name): Let you set the name of a rule. * rule-context.c (rule_context_find_rule): Find a rule by name. (rule_context_create_part): Helper to find and clone a part by name. * filter-folder.c (button_clicked): Fix warning. * filter.glade: Add new widgets for vfolder rule editor. * vfolder-context.c (vfolder_context_init): Changed to use vfolder rule as the rule type. * vfolder-rule.c: New class to encode extra information required for vfolder rules. svn path=/trunk/; revision=4421 --- filter/filter-rule.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'filter/filter-rule.c') diff --git a/filter/filter-rule.c b/filter/filter-rule.c index 9e1da43164..9c47af6daf 100644 --- a/filter/filter-rule.c +++ b/filter/filter-rule.c @@ -133,6 +133,12 @@ filter_rule_new(void) return o; } +void filter_rule_set_name (FilterRule *fr, const char *name) +{ + g_free(fr->name); + fr->name = g_strdup(name); +} + xmlNodePtr filter_rule_xml_encode (FilterRule *fr) { return ((FilterRuleClass *)((GtkObject *)fr)->klass)->xml_encode(fr); @@ -523,3 +529,15 @@ FilterRule *filter_rule_next_list (GList *l, FilterRule *last) return node->data; return NULL; } + +FilterRule *filter_rule_find_list (GList *l, const char *name) +{ + while (l) { + FilterRule *rule = l->data; + if (!strcmp(rule->name, name)) + return rule; + l = g_list_next(l); + } + return NULL; +} + -- cgit