remove main's 'filter' code
authorPaul Mangan <paul@claws-mail.org>
Thu, 31 Oct 2002 13:06:34 +0000 (13:06 +0000)
committerPaul Mangan <paul@claws-mail.org>
Thu, 31 Oct 2002 13:06:34 +0000 (13:06 +0000)
12 files changed:
ChangeLog.claws
configure.in
src/Makefile.am
src/folderview.c
src/inc.c
src/main.c
src/mainwindow.c
src/mbox.c
src/prefs_common.c
src/prefs_filtering.h
src/summaryview.c
src/summaryview.h

index 1713db8d7c2887ac2950d7f47694a550e6cfc49a..5bb22f5d7e3090f15775de682db1a91cdcd41791 100644 (file)
@@ -1,3 +1,19 @@
+2002-10-31 [paul]      0.8.5claws61
+
+       * src/prefs_filter.[ch] ** REMOVED **
+         src/filter.[ch]       ** REMOVED **
+         
+       * src/Makefile.am
+         src/folderview.c
+         src/inc.c
+         src/main.c
+         src/mainwindow.c
+         src/mbox.c
+         src/prefs_common.c
+         src/prefs_filtering.c
+         src/summaryview.[ch]
+               remove main's 'filter' code
+
 2002-10-31 [paul]      0.8.5claws60
 
        * src/summaryview.c
index 95edb5aa0fef23dd5be2b722d2538552da7e5071..1a2af885b341733302d32be324f8f6bf04a9f54a 100644 (file)
@@ -11,7 +11,7 @@ MINOR_VERSION=8
 MICRO_VERSION=5
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=claws60
+EXTRA_VERSION=claws61
 VERSION=$MAJOR_VERSION.$MINOR_VERSION.$MICRO_VERSION$EXTRA_VERSION
 
 dnl set $target
index 4ba1971b16e28a9c811ba3339527f069370b7267..6b6c3544b057c1b64e34dae3da1acb882a25ed4b 100644 (file)
@@ -19,7 +19,6 @@ sylpheed_SOURCES = \
        folder.c folder.h \
        procmsg.c procmsg.h \
        procheader.c procheader.h \
-       filter.c filter.h \
        compose.c compose.h \
        gtkshruler.c gtkshruler.h \
        gtksctree.c gtksctree.h \
@@ -28,7 +27,6 @@ sylpheed_SOURCES = \
        stock_pixmap.c stock_pixmap.h \
        prefs.c prefs.h \
        prefs_common.c prefs_common.h \
-       prefs_filter.c prefs_filter.h \
        prefs_account.c prefs_account.h \
        prefs_folder_item.c prefs_folder_item.h \
        prefs_display_header.c prefs_display_header.h \
index 804565e49b7277a8ba5d94605d35c79d3e7ba123..183dec10a85f7aa13380e6145e7a5abb6048b9b9 100644 (file)
@@ -54,7 +54,6 @@
 #include "gtkutils.h"
 #include "prefs_common.h"
 #include "prefs_account.h"
-#include "prefs_filter.h"
 #include "prefs_filtering.h"
 #include "prefs_scoring.h"
 #include "prefs_folder_item.h"
@@ -2027,17 +2026,11 @@ static void folderview_rename_folder_cb(FolderView *folderview, guint action,
        }
        g_free(new_folder);
 
-       if (prefs_common.fltlist) {
-               if (folder_get_default_folder() == item->folder)
-                       prefs_filter_rename_path(old_path, item->path);
-               new_id = folder_item_get_identifier(item);
-               prefs_filter_rename_path(old_id, new_id);
-       } else {
-               if (FOLDER_TYPE(item->folder) == F_MH)
-                       prefs_filtering_rename_path(old_path, item->path);
-               new_id = folder_item_get_identifier(item);
-               prefs_filtering_rename_path(old_id, new_id);
-       }
+       if (FOLDER_TYPE(item->folder) == F_MH)
+               prefs_filtering_rename_path(old_path, item->path);
+       new_id = folder_item_get_identifier(item);
+       prefs_filtering_rename_path(old_id, new_id);
+
        g_free(old_id);
        g_free(new_id);
 
@@ -2156,17 +2149,11 @@ static void folderview_delete_folder_cb(FolderView *folderview, guint action,
                return;
        }
 
-       if (prefs_common.fltlist) {
-               if (folder_get_default_folder() == item->folder)
-                       prefs_filter_delete_path(old_path);
-               prefs_filter_delete_path(old_id);
-               g_free(old_id);
-       } else {
-               if (FOLDER_TYPE(item->folder) == F_MH)
-                       prefs_filtering_delete_path(old_path);
-               prefs_filtering_delete_path(old_id);
-               g_free(old_id);
-       }
+       if (FOLDER_TYPE(item->folder) == F_MH)
+               prefs_filtering_delete_path(old_path);
+       prefs_filtering_delete_path(old_id);
+       g_free(old_id);
+
        if (folderview->opened == folderview->selected ||
            gtk_ctree_is_ancestor(ctree,
                                  folderview->selected,
index c8fd658baf4abc40637c54e6582054da76439535..c66ecb53a98b5f812c168300bbfac1ab85f69d60 100644 (file)
--- a/src/inc.c
+++ b/src/inc.c
@@ -61,7 +61,6 @@
 #include "progressdialog.h"
 #include "inputdialog.h"
 #include "alertpanel.h"
-#include "filter.h"
 #include "automaton.h"
 #include "folder.h"
 #include "filtering.h"
@@ -997,21 +996,7 @@ gint inc_drop_message(const gchar *file, Pop3State *state)
        }
 
        /* CLAWS: claws uses a global .processing folder for the filtering. */
-       if (global_processing == NULL) {
-               if (state->ac_prefs->filter_on_recv) {
-                       dropfolder =
-                               filter_get_dest_folder(prefs_common.fltlist, file);
-                       if (!dropfolder) dropfolder = inbox;
-                       else if (!strcmp(dropfolder->path, FILTER_NOT_RECEIVE)) {
-                               debug_print("a message won't be received\n");
-                               unlink(file);
-                               return 1;
-                       }
-               } else
-                       dropfolder = inbox;
-       } else {
-               dropfolder = folder_get_default_processing();
-       }
+       dropfolder = folder_get_default_processing();
 
        /* add msg file to drop folder */
        if ((msgnum = folder_item_add_msg(dropfolder, file, TRUE)) < 0) {
index c3abca9ca94be8c6f4bfe1b9e9d5ef6207afee39..5aaddc1b8527bbc1b71560fb8135975bbaf8b53b 100644 (file)
@@ -56,7 +56,6 @@
 #include "folderview.h"
 #include "summaryview.h"
 #include "prefs_common.h"
-#include "prefs_filter.h"
 #include "prefs_account.h"
 #include "prefs_actions.h"
 #include "scoring.h"
@@ -289,8 +288,6 @@ int main(int argc, char *argv[])
        
 
        prefs_common_save_config();
-       prefs_filter_read_config();
-       prefs_filter_write_config();
        prefs_actions_read_config();
        prefs_actions_write_config();
        prefs_display_header_read_config();
@@ -551,7 +548,6 @@ void app_will_exit(GtkWidget *widget, gpointer data)
        main_window_get_size(mainwin);
        main_window_get_position(mainwin);
        prefs_common_save_config();
-       prefs_filter_write_config();
        account_save_config_all();
        addressbook_export_to_file();
 
index c854ee82284fe3194117682cd8e9389316327996..c4eff591729273128e4b537eb27e50a7d50ae4eb 100644 (file)
@@ -60,7 +60,6 @@
 #include "import.h"
 #include "export.h"
 #include "prefs_common.h"
-#include "prefs_filter.h"
 #include "prefs_actions.h"
 #include "prefs_filtering.h"
 #include "prefs_scoring.h"
index 59cae3b1f81d30b059cadd90356834c8fc62d9f1..65f07bc28fc2342d525cd677bf763238c583640f 100644 (file)
@@ -36,7 +36,6 @@
 #include "mbox.h"
 #include "procmsg.h"
 #include "folder.h"
-#include "filter.h"
 #include "prefs_common.h"
 #include "prefs_account.h"
 #include "account.h"
@@ -203,18 +202,7 @@ gint proc_mbox(FolderItem *dest, const gchar *mbox)
                        return -1;
                }
 
-               if (global_processing == NULL) {
-                       /* old filtering */
-                       dropfolder = filter_get_dest_folder
-                               (prefs_common.fltlist, tmp_file);
-                       if (!dropfolder ||
-                           !strcmp(dropfolder->path, FILTER_NOT_RECEIVE))
-                               dropfolder = dest;
-               } else {
-                       /* CLAWS: new filtering */
-                       dropfolder = folder_get_default_processing();
-               }
-
+               dropfolder = folder_get_default_processing();
                        
                if ((msgnum = folder_item_add_msg(dropfolder, tmp_file, TRUE)) < 0) {
                        fclose(mbox_fp);
@@ -223,11 +211,8 @@ gint proc_mbox(FolderItem *dest, const gchar *mbox)
                        return -1;
                }
 
-               if (global_processing) {
-                       /* CLAWS: new filtering */
-                       filter_message(global_processing, dest,
-                                      msgnum);
-               }
+               filter_message(global_processing, dest,
+                              msgnum);
 
                msgs++;
        } while (from_line[0] != '\0');
index a7e4281490394ed1c61a7875ff0a1fd3a7bb001f..07360a3324acce222cb663858ab173282e8ca23a 100644 (file)
@@ -903,7 +903,6 @@ static void prefs_common_apply              (void);
 static void prefs_common_cancel                (void);
 
 void prefs_common_init() {
-       prefs_common.fltlist = NULL;
        prefs_common.disphdr_list = NULL;
 }
 
index 224d25e5a62c55a3e4c7029805cb825d1662aa60..b3d6b68a1999b1572eb23c5c913e34e88fa8ab54 100644 (file)
 void prefs_scoring_read_config (void);
 void prefs_scoring_write_config        (void);
 */
+
+typedef enum
+{
+       FILTER_BY_NONE,
+       FILTER_BY_AUTO,
+       FILTER_BY_FROM,
+       FILTER_BY_TO,
+       FILTER_BY_SUBJECT
+} PrefsFilterType;
+
 void prefs_filtering_open              (FolderItem * item,
                                         const gchar    *header,
                                         const gchar    *key);
index ea9e54577397179631d51c53a9f24963782372c8..8b2c2f203a1d7d9e526ff31d8de95226f3905a20 100644 (file)
@@ -61,7 +61,6 @@
 #include "sourcewindow.h"
 #include "prefs_common.h"
 #include "prefs_summary_column.h"
-#include "prefs_filter.h"
 #include "prefs_filtering.h"
 #include "account.h"
 #include "compose.h"
@@ -72,7 +71,6 @@
 #include "alertpanel.h"
 #include "inputdialog.h"
 #include "statusbar.h"
-#include "filter.h"
 #include "folder.h"
 #include "colorlabel.h"
 #include "inc.h"
@@ -3817,7 +3815,7 @@ void summary_collapse_threads(SummaryView *summaryview)
 
 void summary_filter(SummaryView *summaryview)
 {
-       if (!prefs_common.fltlist && !global_processing) {
+       if (!global_processing) {
                alertpanel_error(_("No filter rules defined."));
                return;
        }
@@ -3877,17 +3875,7 @@ static void summary_filter_func(GtkCTree *ctree, GtkCTreeNode *node,
        gchar *file;
        FolderItem *dest;
 
-       if (global_processing == NULL) {
-               /* old filtering */
-               file = procmsg_get_message_file(msginfo);
-               dest = filter_get_dest_folder(prefs_common.fltlist, file);
-               g_free(file);
-
-               if (dest && strcmp2(dest->path, FILTER_NOT_RECEIVE) != 0 &&
-                   summaryview->folder_item != dest)
-                       summary_move_row_to(summaryview, node, dest);
-       } else 
-               filter_message_by_msginfo(global_processing, msginfo);
+       filter_message_by_msginfo(global_processing, msginfo);
 }
 
 void summary_filter_open(SummaryView *summaryview, PrefsFilterType type)
index 2e60c6f6a66bf521f39db616d80e65abdbc4cfea..5b56d87934f92ba032141bfeed928c1ff7b3e69e 100644 (file)
@@ -37,9 +37,9 @@ typedef struct _SummaryColumnState    SummaryColumnState;
 #include "headerview.h"
 #include "messageview.h"
 #include "compose.h"
-#include "prefs_filter.h"
 #include "folder.h"
 #include "gtksctree.h"
+#include "prefs_filtering.h"
 
 typedef enum
 {