From e758de5b1d7f0e257ff034caa9d73db64607a800 Mon Sep 17 00:00:00 2001 From: Srinivasa Ragavan Date: Thu, 1 Mar 2012 22:34:32 +0530 Subject: Redo Filters/Search folder editors to use a shared non ui based library for making search folders running remotely. --- filter/e-rule-context.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'filter') diff --git a/filter/e-rule-context.c b/filter/e-rule-context.c index 444b6c3388..175e885d8a 100644 --- a/filter/e-rule-context.c +++ b/filter/e-rule-context.c @@ -582,7 +582,11 @@ e_rule_context_add_part_set (ERuleContext *context, g_return_if_fail (append != NULL); g_return_if_fail (next != NULL); - g_return_if_fail (g_hash_table_lookup (context->part_set_map, setname) == NULL); + if ((map = g_hash_table_lookup (context->part_set_map, setname)) != NULL) { + g_hash_table_remove (context->part_set_map, setname); + free_part_set (map); + map = NULL; + } map = g_malloc0 (sizeof (*map)); map->type = part_type; @@ -607,7 +611,11 @@ e_rule_context_add_rule_set (ERuleContext *context, g_return_if_fail (append != NULL); g_return_if_fail (next != NULL); - g_return_if_fail (g_hash_table_lookup (context->rule_set_map, setname) == NULL); + if ((map = g_hash_table_lookup (context->rule_set_map, setname)) != NULL) { + g_hash_table_remove (context->rule_set_map, setname); + free_rule_set (map); + map = NULL; + } map = g_malloc0 (sizeof (*map)); map->type = rule_type; -- cgit