talons

Fork of Claws Mail https://www.claws-mail
Log | Files | Refs | README | LICENSE

commit 216120e6ec7a5599c8268b896de11e1732c7a1fd
parent 216b85c526fe5feca950a179b363d75a5777bad3
Author: Paweł Pękala <c0rn@gazeta.pl>
Date:   Sun, 20 Nov 2011 21:06:58 +0000

2011-11-20 [pawel]	3.7.10cvs96

	* src/filtering.c
	* src/filtering.h
	* src/prefs_actions.c
		Fix bug #1489 'Filter action mark_as_read inoperative
		following move action'
		Sort actions lists to have proper order of execution

Diffstat:
MChangeLog | 9+++++++++
MPATCHSETS | 1+
Mconfigure.ac | 2+-
Msrc/filtering.c | 15++++++++++++++-
Msrc/filtering.h | 2++
Msrc/prefs_actions.c | 1+
6 files changed, 28 insertions(+), 2 deletions(-)

diff --git a/ChangeLog b/ChangeLog @@ -1,3 +1,12 @@ +2011-11-20 [pawel] 3.7.10cvs96 + + * src/filtering.c + * src/filtering.h + * src/prefs_actions.c + Fix bug #1489 'Filter action mark_as_read inoperative + following move action' + Sort actions lists to have proper order of execution + 2011-11-20 [pawel] 3.7.10cvs95 * src/prefs_actions.c diff --git a/PATCHSETS b/PATCHSETS @@ -4299,3 +4299,4 @@ ( cvs diff -u -r 1.1.2.59 -r 1.1.2.60 manual/advanced.xml; ) > 3.7.10cvs93.patchset ( cvs diff -u -r 1.83.2.182 -r 1.83.2.183 src/mimeview.c; ) > 3.7.10cvs94.patchset ( cvs diff -u -r 1.60.2.75 -r 1.60.2.76 src/prefs_actions.c; cvs diff -u -r 1.59.2.84 -r 1.59.2.85 src/prefs_filtering.c; cvs diff -u -r 1.12.2.79 -r 1.12.2.80 src/prefs_template.c; ) > 3.7.10cvs95.patchset +( cvs diff -u -r 1.60.2.58 -r 1.60.2.59 src/filtering.c; cvs diff -u -r 1.21.2.19 -r 1.21.2.20 src/filtering.h; cvs diff -u -r 1.60.2.76 -r 1.60.2.77 src/prefs_actions.c; ) > 3.7.10cvs96.patchset diff --git a/configure.ac b/configure.ac @@ -12,7 +12,7 @@ MINOR_VERSION=7 MICRO_VERSION=10 INTERFACE_AGE=0 BINARY_AGE=0 -EXTRA_VERSION=95 +EXTRA_VERSION=96 EXTRA_RELEASE= EXTRA_GTK2_VERSION= diff --git a/src/filtering.c b/src/filtering.c @@ -93,6 +93,19 @@ void filteringaction_free(FilteringAction * action) g_free(action); } +static gint action_list_sort(gconstpointer a, gconstpointer b) +{ + int first = filtering_is_final_action((FilteringAction *) a) ? 1 : 0; + int second = filtering_is_final_action((FilteringAction *) b) ? 1 : 0; + + return (first - second); +} + +GSList *filtering_action_list_sort(GSList *action_list) +{ + return g_slist_sort(action_list, action_list_sort); +} + FilteringProp * filteringprop_new(gboolean enabled, const gchar *name, gint account_id, @@ -106,7 +119,7 @@ FilteringProp * filteringprop_new(gboolean enabled, filtering->name = name ? g_strdup(name): NULL; filtering->account_id = account_id; filtering->matchers = matchers; - filtering->action_list = action_list; + filtering->action_list = filtering_action_list_sort(action_list); return filtering; } diff --git a/src/filtering.h b/src/filtering.h @@ -106,4 +106,6 @@ extern GSList * post_global_processing; gboolean filtering_peek_per_account_rules(GSList *filtering_list); +GSList *filtering_action_list_sort(GSList *action_list); + #endif diff --git a/src/prefs_actions.c b/src/prefs_actions.c @@ -1324,6 +1324,7 @@ static void prefs_action_define_filter_done(GSList * action_list) if (action_list == NULL) return; + action_list = filtering_action_list_sort(action_list); str = filteringaction_list_to_string(action_list); if (str != NULL) {