[Commits] filtering.c 1.60.2.58 1.60.2.59 filtering.h 1.21.2.19 1.21.2.20 prefs_actions.c 1.60.2.76 1.60.2.77

pawel at claws-mail.org pawel at claws-mail.org
Sun Nov 20 22:06:59 CET 2011


Update of /home/claws-mail/claws/src
In directory claws-mail:/tmp/cvs-serv32270/src

Modified Files:
      Tag: gtk2
	filtering.c filtering.h prefs_actions.c 
Log Message:
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

Index: prefs_actions.c
===================================================================
RCS file: /home/claws-mail/claws/src/prefs_actions.c,v
retrieving revision 1.60.2.76
retrieving revision 1.60.2.77
diff -u -d -r1.60.2.76 -r1.60.2.77
--- prefs_actions.c	20 Nov 2011 18:47:07 -0000	1.60.2.76
+++ prefs_actions.c	20 Nov 2011 21:06:57 -0000	1.60.2.77
@@ -1324,6 +1324,7 @@
 	if (action_list == NULL)
 		return;
 
+	action_list = filtering_action_list_sort(action_list);
 	str = filteringaction_list_to_string(action_list);
 
 	if (str != NULL) {

Index: filtering.c
===================================================================
RCS file: /home/claws-mail/claws/src/filtering.c,v
retrieving revision 1.60.2.58
retrieving revision 1.60.2.59
diff -u -d -r1.60.2.58 -r1.60.2.59
--- filtering.c	23 Oct 2011 14:36:21 -0000	1.60.2.58
+++ filtering.c	20 Nov 2011 21:06:57 -0000	1.60.2.59
@@ -93,6 +93,19 @@
 	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 @@
 	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;
 }

Index: filtering.h
===================================================================
RCS file: /home/claws-mail/claws/src/filtering.h,v
retrieving revision 1.21.2.19
retrieving revision 1.21.2.20
diff -u -d -r1.21.2.19 -r1.21.2.20
--- filtering.h	16 Feb 2011 07:15:58 -0000	1.21.2.19
+++ filtering.h	20 Nov 2011 21:06:57 -0000	1.21.2.20
@@ -106,4 +106,6 @@
 
 gboolean filtering_peek_per_account_rules(GSList *filtering_list);
 
+GSList *filtering_action_list_sort(GSList *action_list);
+
 #endif



More information about the Commits mailing list