2006-02-06 [colin] 2.0.0cvs24
authorColin Leroy <colin@colino.net>
Mon, 6 Feb 2006 21:30:43 +0000 (21:30 +0000)
committerColin Leroy <colin@colino.net>
Mon, 6 Feb 2006 21:30:43 +0000 (21:30 +0000)
* src/folder.c
* src/summaryview.c
Batch filtering in summaryview (from Tools menu)
and pre/post//-processing too

ChangeLog
PATCHSETS
configure.ac
src/folder.c
src/summaryview.c

index d0eb9dfd724174a4f04d8f42fc876e6ec2b652f7..a6e53d49a9774a3864120d153fbbb0a0308186f9 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2006-02-06 [colin]     2.0.0cvs24
+
+       * src/folder.c
+       * src/summaryview.c
+               Batch filtering in summaryview (from Tools menu)
+               and pre/post//-processing too
+
 2006-02-06 [colin]     2.0.0cvs23
 
        * src/procmsg.h
index 4137dfd312ebb2fe0304c38d85ef10bbb7c23e6d..b696de5c3beac92431e7268652ec5acf777b9055 100644 (file)
--- a/PATCHSETS
+++ b/PATCHSETS
 ( cvs diff -u -r 1.179.2.91 -r 1.179.2.92 src/imap.c;  cvs diff -u -r 1.60.2.9 -r 1.60.2.10 src/filtering.c;  cvs diff -u -r 1.21.2.4 -r 1.21.2.5 src/filtering.h;  cvs diff -u -r 1.149.2.42 -r 1.149.2.43 src/inc.c;  cvs diff -u -r 1.213.2.78 -r 1.213.2.79 src/folder.c;  cvs diff -u -r 1.28.2.12 -r 1.28.2.13 src/mbox.c;  cvs diff -u -r 1.150.2.50 -r 1.150.2.51 src/procmsg.c; cvs diff -u -r 1.60.2.21 -r 1.60.2.22 src/procmsg.h; ) > 2.0.0cvs21.patchset
 ( cvs diff -u -r 1.12.2.29 -r 1.12.2.30 src/action.c;  cvs diff -u -r 1.60.2.10 -r 1.60.2.11 src/filtering.c;  cvs diff -u -r 1.21.2.5 -r 1.21.2.6 src/filtering.h;  cvs diff -u -r 1.213.2.79 -r 1.213.2.80 src/folder.c;  cvs diff -u -r 1.395.2.164 -r 1.395.2.165 src/summaryview.c;  ) > 2.0.0cvs22.patchset
 ( cvs diff -u -r 1.60.2.22 -r 1.60.2.23 src/procmsg.h;  cvs diff -u -r 1.60.2.11 -r 1.60.2.12 src/filtering.c;  ) > 2.0.0cvs23.patchset
+( cvs diff -u -r 1.213.2.80 -r 1.213.2.81 src/folder.c;  cvs diff -u -r 1.395.2.165 -r 1.395.2.166 src/summaryview.c;  ) > 2.0.0cvs24.patchset
index 2a185ff3251d3d6aebd1bf24af62d753aefddc40..0c9490295fe05facefbf8826967c391793705a0b 100644 (file)
@@ -11,7 +11,7 @@ MINOR_VERSION=0
 MICRO_VERSION=0
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=23
+EXTRA_VERSION=24
 EXTRA_RELEASE=
 EXTRA_GTK2_VERSION=
 
index 6ae756d53973afa035c03dab8813755b22cec9e0..91bdb4194166cad11db71ebfaf4399ca8f1b026e 100644 (file)
@@ -3546,16 +3546,19 @@ void folder_item_apply_processing(FolderItem *item)
 
                 /* apply pre global rules */
                filter_message_by_msginfo(pre_global_processing, msginfo);
-                filtering_move_and_copy_msg(msginfo);
                
                 /* apply rules of the folder */
                filter_message_by_msginfo(processing_list, msginfo);
-               filtering_move_and_copy_msg(msginfo);
 
                 /* apply post global rules */
                filter_message_by_msginfo(post_global_processing, msginfo);
-               filtering_move_and_copy_msg(msginfo);
                 
+       }
+       if (pre_global_processing || processing_list
+           || post_global_processing)
+               filtering_move_and_copy_msgs(mlist);
+       for (cur = mlist ; cur != NULL ; cur = cur->next) {
+               MsgInfo * msginfo;
                procmsg_msginfo_free(msginfo);
        }
        g_slist_free(mlist);
index 56dc0ff8d38f190a735a6e88672c6dfafa9c734c..c677d03fa938d9c781c3e69e3df71d977d50c389 100644 (file)
@@ -237,9 +237,7 @@ void summary_simplify_subject(SummaryView *summaryview, gchar * rexp,
 #if 0
 void summary_processing(SummaryView *summaryview, GSList * mlist);
 #endif
-static void summary_filter_func                (GtkCTree               *ctree,
-                                        GtkCTreeNode           *node,
-                                        gpointer                data);
+static void summary_filter_func                (MsgInfo *msginfo);
 
 static void summary_colorlabel_menu_item_activate_cb
                                          (GtkWidget    *widget,
@@ -4203,6 +4201,7 @@ void summary_collapse_threads(SummaryView *summaryview)
 
 void summary_filter(SummaryView *summaryview, gboolean selected_only)
 {
+       GSList *mlist = NULL, *cur_list;
        summary_lock(summaryview);
 
        folder_item_update_freeze();
@@ -4218,15 +4217,23 @@ void summary_filter(SummaryView *summaryview, gboolean selected_only)
 
                for (cur = GTK_CLIST(summaryview->ctree)->selection;
                     cur != NULL && cur->data != NULL; cur = cur->next) {
-                       summary_filter_func(GTK_CTREE(summaryview->ctree),
-                                           GTK_CTREE_NODE(cur->data),
-                                           summaryview);
+                       mlist = g_slist_prepend(mlist, 
+                                procmsg_msginfo_new_ref(
+                                 GTKUT_CTREE_NODE_GET_ROW_DATA(cur)));
                }
+               mlist = g_slist_reverse(mlist);
        } else {
-               gtk_ctree_pre_recursive(GTK_CTREE(summaryview->ctree), NULL,
-                                       GTK_CTREE_FUNC(summary_filter_func),
-                                       summaryview);
+               mlist = folder_item_get_msg_list(summaryview->folder_item);
+       }
+       for (cur_list = mlist; cur_list; cur_list = cur_list->next) {
+               summary_filter_func((MsgInfo *)cur_list->data);
        }
+       filtering_move_and_copy_msgs(mlist);
+       for (cur_list = mlist; cur_list; cur_list = cur_list->next) {
+               procmsg_msginfo_free((MsgInfo *)cur_list->data);
+       }
+       g_slist_free(mlist);
+
        gtk_clist_thaw(GTK_CLIST(summaryview->ctree));
 
        folder_item_update_thaw();
@@ -4243,18 +4250,15 @@ void summary_filter(SummaryView *summaryview, gboolean selected_only)
        summary_show(summaryview, summaryview->folder_item);
 }
 
-static void summary_filter_func(GtkCTree *ctree, GtkCTreeNode *node,
-                               gpointer data)
+static void summary_filter_func(MsgInfo *msginfo)
 {
        MailFilteringData mail_filtering_data;
-       MsgInfo *msginfo = GTKUT_CTREE_NODE_GET_ROW_DATA(node);
 
        mail_filtering_data.msginfo = msginfo;
        if (hooks_invoke(MAIL_MANUAL_FILTERING_HOOKLIST, &mail_filtering_data))
                return;
 
        filter_message_by_msginfo(filtering_rules, msginfo);
-       filtering_move_and_copy_msg(msginfo);
 }
 
 void summary_msginfo_filter_open(FolderItem * item, MsgInfo *msginfo,