diff options
Diffstat (limited to 'src/filter.c')
-rw-r--r-- | src/filter.c | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/src/filter.c b/src/filter.c index 873211c5..8d85b95c 100644 --- a/src/filter.c +++ b/src/filter.c @@ -1194,6 +1194,43 @@ void filter_rule_delete_action_by_dest_path(FilterRule *rule, const gchar *path) } } +void filter_list_rename_path(const gchar *old_path, const gchar *new_path) +{ + GSList *cur; + + g_return_if_fail(old_path != NULL); + g_return_if_fail(new_path != NULL); + + for (cur = prefs_common.fltlist; cur != NULL; cur = cur->next) { + FilterRule *rule = (FilterRule *)cur->data; + filter_rule_rename_dest_path(rule, old_path, new_path); + } + + filter_write_config(); +} + +void filter_list_delete_path(const gchar *path) +{ + GSList *cur; + GSList *next; + + g_return_if_fail(path != NULL); + + for (cur = prefs_common.fltlist; cur != NULL; cur = next) { + FilterRule *rule = (FilterRule *)cur->data; + next = cur->next; + + filter_rule_delete_action_by_dest_path(rule, path); + if (!rule->action_list) { + prefs_common.fltlist = + g_slist_remove(prefs_common.fltlist, rule); + filter_rule_free(rule); + } + } + + filter_write_config(); +} + void filter_rule_match_type_str_to_enum(const gchar *match_type, FilterMatchType *type, FilterMatchFlag *flag) |