aboutsummaryrefslogtreecommitdiffstats
path: root/filter
diff options
context:
space:
mode:
authorNot Zed <NotZed@HelixCode.com>2000-07-31 23:38:13 +0800
committerMichael Zucci <zucchi@src.gnome.org>2000-07-31 23:38:13 +0800
commitdc63c5e22284b78da388f28ae0369b72903a8173 (patch)
treefbffbb3aa0203aa0df2077b925b9374b2704f732 /filter
parent72092414aa9b150b03b69b26e216d2d057110f92 (diff)
downloadgsoc2013-evolution-dc63c5e22284b78da388f28ae0369b72903a8173.tar
gsoc2013-evolution-dc63c5e22284b78da388f28ae0369b72903a8173.tar.gz
gsoc2013-evolution-dc63c5e22284b78da388f28ae0369b72903a8173.tar.bz2
gsoc2013-evolution-dc63c5e22284b78da388f28ae0369b72903a8173.tar.lz
gsoc2013-evolution-dc63c5e22284b78da388f28ae0369b72903a8173.tar.xz
gsoc2013-evolution-dc63c5e22284b78da388f28ae0369b72903a8173.tar.zst
gsoc2013-evolution-dc63c5e22284b78da388f28ae0369b72903a8173.zip
If there are no user rules, dont bomb out.
2000-08-01 Not Zed <NotZed@HelixCode.com> * rule-context.c (load): If there are no user rules, dont bomb out. svn path=/trunk/; revision=4424
Diffstat (limited to 'filter')
-rw-r--r--filter/ChangeLog5
-rw-r--r--filter/rule-context.c46
2 files changed, 26 insertions, 25 deletions
diff --git a/filter/ChangeLog b/filter/ChangeLog
index 70ef7fe69d..13b2ef15fa 100644
--- a/filter/ChangeLog
+++ b/filter/ChangeLog
@@ -1,3 +1,8 @@
+2000-08-01 Not Zed <NotZed@HelixCode.com>
+
+ * rule-context.c (load): If there are no user rules, dont bomb
+ out.
+
2000-07-31 Not Zed <NotZed@HelixCode.com>
* filter-input.c (filter_input_set_value): Set value of a simple
diff --git a/filter/rule-context.c b/filter/rule-context.c
index 5335882932..6d43a99f8c 100644
--- a/filter/rule-context.c
+++ b/filter/rule-context.c
@@ -202,14 +202,8 @@ static int load(RuleContext *f, const char *system, const char *user)
f->system = NULL;
return -1;
}
+ /* doesn't matter if this doens't exist */
f->user = xmlParseFile(user);
- if (f->user == NULL) {
- rule_context_set_error(f, g_strdup_printf("Unable to load user rules '%s': %s",
- system, strerror(errno)));
- xmlFreeDoc(f->system);
- f->system = NULL;
- return -1;
- }
/* now parse structure */
/* get rule parts */
@@ -237,28 +231,30 @@ static int load(RuleContext *f, const char *system, const char *user)
}
/* now load actual rules */
- set = f->user->root->childs;
- while (set) {
- d(printf("set name = %s\n", set->name));
- rule_map = g_hash_table_lookup(f->rule_set_map, set->name);
- if (rule_map) {
- d(printf("loading rules ...\n"));
- rule = set->childs;
- while (rule) {
- printf("checking node: %s\n", rule->name);
- if (!strcmp(rule->name, "rule")) {
- FilterRule *part = FILTER_RULE(gtk_type_new(rule_map->type));
- if (filter_rule_xml_decode(part, rule, f) == 0) {
- rule_map->append(f, part);
- } else {
- gtk_object_unref((GtkObject *)part);
- g_warning("Cannot load filter part");
+ if (f->user) {
+ set = f->user->root->childs;
+ while (set) {
+ d(printf("set name = %s\n", set->name));
+ rule_map = g_hash_table_lookup(f->rule_set_map, set->name);
+ if (rule_map) {
+ d(printf("loading rules ...\n"));
+ rule = set->childs;
+ while (rule) {
+ printf("checking node: %s\n", rule->name);
+ if (!strcmp(rule->name, "rule")) {
+ FilterRule *part = FILTER_RULE(gtk_type_new(rule_map->type));
+ if (filter_rule_xml_decode(part, rule, f) == 0) {
+ rule_map->append(f, part);
+ } else {
+ gtk_object_unref((GtkObject *)part);
+ g_warning("Cannot load filter part");
+ }
}
+ rule = rule->next;
}
- rule = rule->next;
}
+ set = set->next;
}
- set = set->next;
}
return 0;
}