2008-09-29 [colin] 3.5.0cvs138
authorColin Leroy <colin@colino.net>
Mon, 29 Sep 2008 16:16:13 +0000 (16:16 +0000)
committerColin Leroy <colin@colino.net>
Mon, 29 Sep 2008 16:16:13 +0000 (16:16 +0000)
* src/folder_item_prefs.c
* src/folder_item_prefs.h
* src/matcher.c
* src/prefs_folder_item.c
* src/prefs_matcher.c
* src/summaryview.c
* src/common/string_match.c
* src/common/utils.c
Fix a huge leak (dozens of megs per folder
change) on Windows: disable regexps

ChangeLog
PATCHSETS
configure.ac
src/common/string_match.c
src/common/utils.c
src/folder_item_prefs.c
src/folder_item_prefs.h
src/matcher.c
src/prefs_folder_item.c
src/prefs_matcher.c
src/summaryview.c

index a9e5ff0..dbc2266 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,16 @@
+2008-09-29 [colin]     3.5.0cvs138
+
+       * src/folder_item_prefs.c
+       * src/folder_item_prefs.h
+       * src/matcher.c
+       * src/prefs_folder_item.c
+       * src/prefs_matcher.c
+       * src/summaryview.c
+       * src/common/string_match.c
+       * src/common/utils.c
+               Fix a huge leak (dozens of megs per folder
+               change) on Windows: disable regexps 
+
 2008-09-28 [paul]      3.5.0cvs137
 
        * po/en_GB.po
index 39b7679..d17ff1e 100644 (file)
--- a/PATCHSETS
+++ b/PATCHSETS
 ( cvs diff -u -r 1.179.2.230 -r 1.179.2.231 src/imap.c;  ) > 3.5.0cvs135.patchset
 ( cvs diff -u -r 1.61.2.88 -r 1.61.2.89 src/account.c;  cvs diff -u -r 1.11.2.12 -r 1.11.2.13 src/account.h;  ) > 3.5.0cvs136.patchset
 ( cvs diff -u -r 1.12.2.17 -r 1.12.2.18 po/en_GB.po;  ) > 3.5.0cvs137.patchset
+( cvs diff -u -r 1.2.2.31 -r 1.2.2.32 src/folder_item_prefs.c;  cvs diff -u -r 1.2.2.18 -r 1.2.2.19 src/folder_item_prefs.h;  cvs diff -u -r 1.75.2.60 -r 1.75.2.61 src/matcher.c;  cvs diff -u -r 1.52.2.69 -r 1.52.2.70 src/prefs_folder_item.c;  cvs diff -u -r 1.43.2.76 -r 1.43.2.77 src/prefs_matcher.c;  cvs diff -u -r 1.395.2.391 -r 1.395.2.392 src/summaryview.c;  cvs diff -u -r 1.1.4.5 -r 1.1.4.6 src/common/string_match.c;  cvs diff -u -r 1.36.2.150 -r 1.36.2.151 src/common/utils.c;  ) > 3.5.0cvs138.patchset
index c6b3d6a..e19e3fc 100644 (file)
@@ -11,7 +11,7 @@ MINOR_VERSION=5
 MICRO_VERSION=0
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=137
+EXTRA_VERSION=138
 EXTRA_RELEASE=
 EXTRA_GTK2_VERSION=
 
index 31962dc..c315661 100644 (file)
@@ -51,7 +51,9 @@ gchar *string_remove_match(gchar *buf, gint buflen, gchar * txt, regex_t *preg)
        regmatch_t match;
        int notfound;
        gint i, j ,k;
-
+#ifdef G_OS_WIN32
+       return txt;
+#else
        if (!preg)
                return txt;
        if (*txt != 0x00) {
@@ -83,5 +85,6 @@ gchar *string_remove_match(gchar *buf, gint buflen, gchar * txt, regex_t *preg)
                return buf;             
        }
        return txt;
+#endif
 }
 
index 7df3eaf..a157886 100644 (file)
@@ -3619,19 +3619,25 @@ void subject_table_remove(GHashTable *subject_table, gchar * subject)
  *             for a "clean" subject line. If no prefix was found, 0
  *             is returned.
  */
+#ifndef G_OS_WIN32
 static regex_t u_regex;
 static gboolean u_init_;
+#endif
 
 void utils_free_regex(void)
 {
+#ifndef G_OS_WIN32
        if (u_init_) {
                regfree(&u_regex);
                u_init_ = FALSE;
        }
+#endif
 }
 
 int subject_get_prefix_length(const gchar *subject)
 {
+#ifndef G_OS_WIN32
        /*!< Array with allowable reply prefixes regexps. */
        static const gchar * const prefixes[] = {
                "Re\\:",                        /* "Re:" */
@@ -3690,8 +3696,38 @@ int subject_get_prefix_length(const gchar *subject)
                return pos.rm_eo;
        else
                return 0;
-}
+#else
+       /*!< Array with allowable reply prefixes regexps. */
+       static const gchar * const prefixes[] = {
+               "Re:",                  /* "Re:" */
+               "Antw:",                        /* "Antw:" (Dutch / German Outlook) */
+               "Aw:",                  /* "Aw:"   (German) */
+               "Antwort:",                     /* "Antwort:" (German Lotus Notes) */
+               "Res:",                 /* "Res:" (Brazilian Outlook) */
+               "Fw:",                  /* "Fw:" Forward */
+               "Fwd:",                 /* "Fwd:" Forward */
+               "Enc:",                 /* "Enc:" Forward (Brazilian Outlook) */
+               "Odp:",                 /* "Odp:" Re (Polish Outlook) */
+               "Rif:",                 /* "Rif:" (Italian Outlook) */
+               "Sv:",                  /* "Sv" (Norwegian) */
+               "Vs:",                  /* "Vs" (Norwegian) */
+               "Ad:",                  /* "Ad" (Norwegian) */
+               /* add more */
+       };
+       const int PREFIXES = sizeof prefixes / sizeof prefixes[0];
+       int n;
+
+       if (!subject) return 0;
+       if (!*subject) return 0;
 
+       for (n = 0; n < PREFIXES; n++) {
+               int len = strlen(prefixes[n]);
+               if (!strncmp(subject, prefixes[n], len))
+                       return len;
+       }
+       return 0;
+#endif
+}
 static guint g_stricase_hash(gconstpointer gptr)
 {
        guint hash_result = 0;
index 1d5e4e7..6c21cc0 100644 (file)
@@ -44,8 +44,10 @@ static PrefParam param[] = {
         NULL, NULL, NULL},
        {"enable_simplify_subject", "", &tmp_prefs.enable_simplify_subject, P_BOOL,
         NULL, NULL, NULL},
+#ifndef G_OS_WIN32
        {"simplify_subject_regexp", "", &tmp_prefs.simplify_subject_regexp, P_STRING,
         NULL, NULL, NULL},
+#endif
        {"enable_folder_chmod", "", &tmp_prefs.enable_folder_chmod, P_BOOL,
         NULL, NULL, NULL},
        {"folder_chmod", "", &tmp_prefs.folder_chmod, P_INT,
@@ -157,7 +159,9 @@ static FolderItemPrefs *folder_item_prefs_clear(FolderItemPrefs *prefs)
        prefs->enable_default_reply_to = FALSE;
        prefs->default_reply_to = NULL;
        prefs->enable_simplify_subject = FALSE;
+#ifndef G_OS_WIN32
        prefs->simplify_subject_regexp = NULL;
+#endif
        prefs->enable_folder_chmod = FALSE;
        prefs->folder_chmod = 0;
        prefs->enable_default_account = FALSE;
@@ -253,7 +257,9 @@ void folder_item_prefs_copy_prefs(FolderItem * src, FolderItem * dest)
        tmp_prefs.enable_default_reply_to       = src->prefs->enable_default_reply_to;
        tmp_prefs.default_reply_to              = g_strdup(src->prefs->default_reply_to);
        tmp_prefs.enable_simplify_subject       = src->prefs->enable_simplify_subject;
+#ifndef G_OS_WIN32
        tmp_prefs.simplify_subject_regexp       = g_strdup(src->prefs->simplify_subject_regexp);
+#endif
        tmp_prefs.enable_folder_chmod           = src->prefs->enable_folder_chmod;
        tmp_prefs.folder_chmod                  = src->prefs->folder_chmod;
        tmp_prefs.enable_default_account        = src->prefs->enable_default_account;
index bc90ee4..629c7ab 100644 (file)
@@ -45,7 +45,9 @@ struct _FolderItemPrefs {
        gboolean enable_default_reply_to;
        gchar *default_reply_to;
        gboolean enable_simplify_subject;
+#ifndef G_OS_WIN32
        gchar *simplify_subject_regexp;
+#endif
        gboolean enable_folder_chmod;
        gint folder_chmod;
        gboolean enable_default_account;
index 155c0dd..ba8ee45 100644 (file)
@@ -463,6 +463,7 @@ static gboolean matcherprop_string_match(MatcherProp *prop, const gchar *str,
        switch (prop->matchtype) {
        case MATCHTYPE_REGEXPCASE:
        case MATCHTYPE_REGEXP:
+#ifndef G_OS_WIN32
                if (!prop->preg && (prop->error == 0)) {
                        prop->preg = g_new0(regex_t, 1);
                        /* if regexp then don't use the escaped string */
@@ -505,7 +506,7 @@ static gboolean matcherprop_string_match(MatcherProp *prop, const gchar *str,
                        g_free(stripped);
                }
                break;
-                       
+#endif                 
        case MATCHTYPE_MATCHCASE:
        case MATCHTYPE_MATCH:
                ret = (strstr(str1, down_expr) != NULL);
index 652d536..e67b281 100644 (file)
@@ -77,10 +77,12 @@ struct _FolderItemGeneralPage
        GtkWidget *table;
        GtkWidget *no_save_warning;
        GtkWidget *folder_type;
+#ifndef G_OS_WIN32
        GtkWidget *checkbtn_simplify_subject;
        GtkWidget *entry_simplify_subject;
        GtkWidget *entry_regexp_test_string;
        GtkWidget *entry_regexp_test_result;
+#endif
        GtkWidget *checkbtn_folder_chmod;
        GtkWidget *entry_folder_chmod;
        GtkWidget *folder_color_btn;
@@ -94,7 +96,9 @@ struct _FolderItemGeneralPage
        GtkWidget *checkbtn_remove_old_offlinesync;
        
        /* apply to sub folders */
+#ifndef G_OS_WIN32
        GtkWidget *simplify_subject_rec_checkbtn;
+#endif
        GtkWidget *folder_chmod_rec_checkbtn;
        GtkWidget *folder_color_rec_checkbtn;
        GtkWidget *enable_processing_rec_checkbtn;
@@ -181,9 +185,10 @@ static gint prefs_folder_item_chmod_mode           (gchar *folder_chmod);
 
 static void folder_color_set_dialog(GtkWidget *widget, gpointer data);
 static void clean_cache_cb(GtkWidget *widget, gpointer data);
+#ifndef G_OS_WIN32
 static void folder_regexp_test_cb(GtkWidget *widget, gpointer data);
 static void folder_regexp_set_subject_example_cb(GtkWidget *widget, gpointer data);
-
+#endif
 #define SAFE_STRING(str) \
        (str) ? (str) : ""
 
@@ -206,6 +211,7 @@ static void prefs_folder_item_general_create_widget_func(PrefsPage * page_,
        SpecialFolderItemType type;
        
        GtkWidget *no_save_warning = NULL;
+#ifndef G_OS_WIN32
        GtkWidget *checkbtn_simplify_subject;
        GtkWidget *entry_simplify_subject;
        GtkWidget *hbox_regexp;
@@ -213,7 +219,7 @@ static void prefs_folder_item_general_create_widget_func(PrefsPage * page_,
        GtkWidget *entry_regexp_test_string;
        GtkWidget *left_arrow;
        GtkWidget *entry_regexp_test_result;
-
+#endif
        GtkWidget *checkbtn_folder_chmod;
        GtkWidget *entry_folder_chmod;
        GtkWidget *folder_color;
@@ -227,7 +233,9 @@ static void prefs_folder_item_general_create_widget_func(PrefsPage * page_,
        GtkWidget *label_end_offlinesync;
        GtkWidget *checkbtn_remove_old_offlinesync;
 
+#ifndef G_OS_WIN32
        GtkWidget *simplify_subject_rec_checkbtn;
+#endif
        GtkWidget *folder_chmod_rec_checkbtn;
        GtkWidget *folder_color_rec_checkbtn;
        GtkWidget *enable_processing_rec_checkbtn;
@@ -313,6 +321,7 @@ static void prefs_folder_item_general_create_widget_func(PrefsPage * page_,
 
        rowcount++;
 
+#ifndef G_OS_WIN32
        /* Simplify Subject */
        checkbtn_simplify_subject = gtk_check_button_new_with_label(_("Simplify Subject RegExp"));
        gtk_table_attach(GTK_TABLE(table), checkbtn_simplify_subject, 0, 1, 
@@ -370,7 +379,7 @@ static void prefs_folder_item_general_create_widget_func(PrefsPage * page_,
        gtk_editable_set_editable(GTK_EDITABLE(entry_regexp_test_result), FALSE);
 
        rowcount++;
-
+#endif
        /* Folder chmod */
        checkbtn_folder_chmod = gtk_check_button_new_with_label(_("Folder chmod"));
        gtk_table_attach(GTK_TABLE(table), checkbtn_folder_chmod, 0, 1, 
@@ -564,10 +573,12 @@ static void prefs_folder_item_general_create_widget_func(PrefsPage * page_,
        page->table = table;
        page->folder_type = folder_type;
        page->no_save_warning = no_save_warning;
+#ifndef G_OS_WIN32
        page->checkbtn_simplify_subject = checkbtn_simplify_subject;
        page->entry_simplify_subject = entry_simplify_subject;
        page->entry_regexp_test_string = entry_regexp_test_string;
        page->entry_regexp_test_result = entry_regexp_test_result;
+#endif
        page->checkbtn_folder_chmod = checkbtn_folder_chmod;
        page->entry_folder_chmod = entry_folder_chmod;
        page->folder_color_btn = folder_color_btn;
@@ -580,7 +591,9 @@ static void prefs_folder_item_general_create_widget_func(PrefsPage * page_,
        page->label_end_offlinesync = label_end_offlinesync;
        page->checkbtn_remove_old_offlinesync = checkbtn_remove_old_offlinesync;
 
+#ifndef G_OS_WIN32
        page->simplify_subject_rec_checkbtn  = simplify_subject_rec_checkbtn;
+#endif
        page->folder_chmod_rec_checkbtn      = folder_chmod_rec_checkbtn;
        page->folder_color_rec_checkbtn      = folder_color_rec_checkbtn;
        page->enable_processing_rec_checkbtn = enable_processing_rec_checkbtn;
@@ -590,7 +603,9 @@ static void prefs_folder_item_general_create_widget_func(PrefsPage * page_,
 
        page->page.widget = table;
 
+#ifndef G_OS_WIN32
        folder_regexp_set_subject_example_cb(NULL, page);
+#endif
 }
 
 static void prefs_folder_item_general_destroy_widget_func(PrefsPage *page_) 
@@ -623,13 +638,14 @@ static void general_save_folder_prefs(FolderItem *folder, FolderItemGeneralPage
                folder_item_change_type(folder, type);
        }
 
+#ifndef G_OS_WIN32
        if (all || gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(page->simplify_subject_rec_checkbtn))) {
                prefs->enable_simplify_subject =
                        gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(page->checkbtn_simplify_subject));
                ASSIGN_STRING(prefs->simplify_subject_regexp,
                              gtk_editable_get_chars(GTK_EDITABLE(page->entry_simplify_subject), 0, -1));
        }
-       
+#endif 
        if (all || gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(page->folder_chmod_rec_checkbtn))) {
                prefs->enable_folder_chmod = 
                        gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(page->checkbtn_folder_chmod));
@@ -688,7 +704,10 @@ static gboolean general_save_recurse_func(GNode *node, gpointer data)
           check boxes are selected - and optimise the checking by only doing
           it once */
        if ((node == page->item->node) &&
-           !(gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(page->simplify_subject_rec_checkbtn)) ||
+           !(
+#ifndef G_OS_WIN32
+             gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(page->simplify_subject_rec_checkbtn)) ||
+#endif
              gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(page->folder_chmod_rec_checkbtn)) ||
              gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(page->folder_color_rec_checkbtn)) ||
              gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(page->enable_processing_rec_checkbtn)) ||
@@ -1466,6 +1485,7 @@ static void clean_cache_cb(GtkWidget *widget, gpointer data)
                folderview_select(folderview,item);
 }
 
+#ifndef G_OS_WIN32
 static regex_t *summary_compile_simplify_regexp(gchar *simplify_subject_regexp)
 {
        int err;
@@ -1562,7 +1582,7 @@ static void folder_regexp_set_subject_example_cb(GtkWidget *widget, gpointer dat
                }
        }
 }
-
+#endif
 static void register_general_page()
 {
        static gchar *pfi_general_path[3];
index 187f5f1..0626f2e 100644 (file)
@@ -90,7 +90,9 @@ static struct Matcher {
        GtkWidget *numeric_label;
        GtkWidget *addressbook_folder_combo;
        GtkWidget *case_checkbtn;
+#ifndef G_OS_WIN32
        GtkWidget *regexp_checkbtn;
+#endif
        GtkWidget *color_optmenu;
 
        GtkWidget *test_btn;
@@ -491,7 +493,9 @@ static void prefs_matcher_create(void)
        GtkWidget *numeric_entry;
        GtkWidget *numeric_label;
        
+#ifndef G_OS_WIN32
        GtkWidget *regexp_checkbtn;
+#endif
        GtkWidget *case_checkbtn;
 
        GtkWidget *reg_hbox;
@@ -694,7 +698,9 @@ static void prefs_matcher_create(void)
        hbox = gtk_hbox_new(FALSE, HSPACING_NARROW);
        gtk_size_group_add_widget(size_group, hbox);
        PACK_CHECK_BUTTON(hbox, case_checkbtn, _("Case sensitive"));
+#ifndef G_OS_WIN32
        PACK_CHECK_BUTTON(hbox, regexp_checkbtn, _("Use regexp"));
+#endif
        gtk_box_pack_end(GTK_BOX(hbox), gtk_label_new(""), TRUE, TRUE, 0);
        gtk_table_attach(GTK_TABLE(table), hbox, 2, 3, 2, 3,
                         GTK_FILL, GTK_SHRINK, 4, 0);
@@ -810,7 +816,9 @@ static void prefs_matcher_create(void)
        matcher.addressbook_folder_combo = addressbook_folder_combo;
        matcher.match_combo = match_combo;
        matcher.case_checkbtn = case_checkbtn;
+#ifndef G_OS_WIN32
        matcher.regexp_checkbtn = regexp_checkbtn;
+#endif
        matcher.bool_op_combo = bool_op_combo;
        matcher.test_btn = test_btn;
        matcher.addressbook_select_btn = addressbook_select_btn;
@@ -874,7 +882,9 @@ static void prefs_matcher_reset_condition(void)
        gtk_entry_set_text(GTK_ENTRY(matcher.header_addr_entry), "");
        gtk_entry_set_text(GTK_ENTRY(matcher.string_entry), "");
        gtk_entry_set_text(GTK_ENTRY(gtk_bin_get_child(GTK_BIN((matcher.addressbook_folder_combo)))), "");
+#ifndef G_OS_WIN32
        gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(matcher.regexp_checkbtn), FALSE);
+#endif
        gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(matcher.case_checkbtn), FALSE);
 }
 
@@ -1345,7 +1355,11 @@ static MatcherProp *prefs_matcher_dialog_to_matcher(void)
        if(value_pred)
                criteria = prefs_matcher_not_criteria(criteria);
 
+#ifndef G_OS_WIN32
        use_regexp = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(matcher.regexp_checkbtn));
+#else
+       use_regexp = FALSE;
+#endif
        case_sensitive = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(matcher.case_checkbtn));
 
        if (use_regexp) {
@@ -1709,15 +1723,19 @@ static void prefs_matcher_second_criteria_sel(GtkWidget *widget,
                        prefs_matcher_enable_widget(matcher.match_label2, TRUE);
                        prefs_matcher_enable_widget(matcher.string_entry, FALSE);
                        prefs_matcher_enable_widget(matcher.case_checkbtn, FALSE);
+#ifndef G_OS_WIN32
                        prefs_matcher_enable_widget(matcher.regexp_checkbtn, FALSE);
+#endif
                } else {
                        prefs_matcher_enable_widget(matcher.upper_filler, TRUE);
                        prefs_matcher_enable_widget(matcher.match_label2, FALSE);
                        prefs_matcher_enable_widget(matcher.string_entry, TRUE);
                        prefs_matcher_enable_widget(matcher.case_checkbtn, TRUE);
+#ifndef G_OS_WIN32
                        prefs_matcher_enable_widget(matcher.regexp_checkbtn, TRUE);
                        gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(
                                                matcher.regexp_checkbtn), FALSE);
+#endif
                        gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(
                                                matcher.case_checkbtn), FALSE);
                }
@@ -1788,8 +1806,10 @@ static void prefs_matcher_criteria_select(GtkWidget *widget,
                                    MATCH_COMBO_IS_ENABLED(value));
        prefs_matcher_enable_widget(matcher.case_checkbtn,
                                    MATCH_CASE_REGEXP(value));
+#ifndef G_OS_WIN32
        prefs_matcher_enable_widget(matcher.regexp_checkbtn,
                                    MATCH_CASE_REGEXP(value));
+#endif
        prefs_matcher_enable_widget(matcher.test_btn,
                                    (value == MATCH_TEST));
        prefs_matcher_enable_widget(matcher.addressbook_select_btn,
@@ -1832,7 +1852,9 @@ static void prefs_matcher_criteria_select(GtkWidget *widget,
                prefs_matcher_set_model(matcher.match_combo, matcher.model_contain);
                gtk_label_set_text(GTK_LABEL(matcher.criteria_label2), _("Name:"));
                gtk_label_set_text(GTK_LABEL(matcher.match_label), _("Header"));
+#ifndef G_OS_WIN32
                gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(matcher.regexp_checkbtn), FALSE);
+#endif
                gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(matcher.case_checkbtn), FALSE);
                break;
        case MATCH_LABEL:
@@ -1849,7 +1871,9 @@ static void prefs_matcher_criteria_select(GtkWidget *widget,
                prefs_matcher_set_model(matcher.criteria_combo2, matcher.model_phrase);
                prefs_matcher_set_model(matcher.match_combo, matcher.model_contain);
                gtk_label_set_text(GTK_LABEL(matcher.criteria_label2), _("in"));
+#ifndef G_OS_WIN32
                gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(matcher.regexp_checkbtn), FALSE);
+#endif
                gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(matcher.case_checkbtn), FALSE);
                prefs_matcher_second_criteria_sel(NULL, NULL);
                break;  
@@ -2460,22 +2484,30 @@ static gboolean prefs_matcher_selected(GtkTreeSelection *selector,
 
        switch(prop->matchtype) {
        case MATCHTYPE_MATCH:
+#ifndef G_OS_WIN32
                gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(matcher.regexp_checkbtn), FALSE);
+#endif
                gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(matcher.case_checkbtn), TRUE);
                break;
 
        case MATCHTYPE_MATCHCASE:
+#ifndef G_OS_WIN32
                gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(matcher.regexp_checkbtn), FALSE);
+#endif
                gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(matcher.case_checkbtn), FALSE);
                break;
 
        case MATCHTYPE_REGEXP:
+#ifndef G_OS_WIN32
                gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(matcher.regexp_checkbtn), TRUE);
+#endif
                gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(matcher.case_checkbtn), TRUE);
                break;
 
        case MATCHTYPE_REGEXPCASE:
+#ifndef G_OS_WIN32
                gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(matcher.regexp_checkbtn), TRUE);
+#endif
                gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(matcher.case_checkbtn), FALSE);
                break;
        }
index d103333..19efbe8 100644 (file)
@@ -1138,8 +1138,9 @@ void summary_init(SummaryView *summaryview)
        summaryview->sort_type = SORT_ASCENDING;
 
        /* Init summaryview extra data */
+#ifndef G_OS_WIN32
        summaryview->simplify_subject_preg = NULL;
-
+#endif
        summary_clear_list(summaryview);
        summary_set_column_titles(summaryview);
        summary_colorlabel_menu_create(summaryview, FALSE);
@@ -2956,9 +2957,11 @@ void summary_sort(SummaryView *summaryview,
                cmp_func = (GtkCMCListCompareFunc)summary_cmp_by_from;
                break;
        case SORT_BY_SUBJECT:
+#ifndef G_OS_WIN32
                if (summaryview->simplify_subject_preg)
                        cmp_func = (GtkCMCListCompareFunc)summary_cmp_by_simplified_subject;
                else
+#endif
                        cmp_func = (GtkCMCListCompareFunc)summary_cmp_by_subject;
                break;
        case SORT_BY_SCORE:
@@ -3362,12 +3365,14 @@ static inline void summary_set_header(SummaryView *summaryview, gchar *text[],
                text[col_pos[S_COL_FROM]] = tmp2;
        }
        
+#ifndef G_OS_WIN32
        if (summaryview->simplify_subject_preg != NULL)
                text[col_pos[S_COL_SUBJECT]] = msginfo->subject ? 
                        string_remove_match(tmp3, BUFFSIZE, msginfo->subject, 
                                        summaryview->simplify_subject_preg) : 
                        _("(No Subject)");
        else 
+#endif
                text[col_pos[S_COL_SUBJECT]] = msginfo->subject ? msginfo->subject :
                        _("(No Subject)");
        if (vert && prefs_common.two_line_vert) {
@@ -5896,11 +5901,13 @@ static void summary_tags_menu_item_activate_item_cb(GtkMenuItem *menu_item,
 
 void summaryview_destroy(SummaryView *summaryview)
 {
+#ifndef G_OS_WIN32
        if(summaryview->simplify_subject_preg) {
                regfree(summaryview->simplify_subject_preg);
                g_free(summaryview->simplify_subject_preg);
                summaryview->simplify_subject_preg = NULL;
        }
+#endif
 }
 static void summary_tags_menu_item_apply_tags_activate_cb(GtkWidget *widget,
                                                     gpointer data)
@@ -7640,6 +7647,7 @@ void summary_harvest_address(SummaryView *summaryview)
        g_list_free( msgList );
 }
 
+#ifndef G_OS_WIN32
 static regex_t *summary_compile_simplify_regexp(gchar *simplify_subject_regexp)
 {
        int err;
@@ -7659,7 +7667,7 @@ static regex_t *summary_compile_simplify_regexp(gchar *simplify_subject_regexp)
        
        return preg;
 }
-
+#endif
 void summary_set_prefs_from_folderitem(SummaryView *summaryview, FolderItem *item)
 {
        FolderSortKey sort_key;
@@ -7668,6 +7676,7 @@ void summary_set_prefs_from_folderitem(SummaryView *summaryview, FolderItem *ite
        g_return_if_fail(item != NULL);
 
        /* Subject simplification */
+#ifndef G_OS_WIN32
        if(summaryview->simplify_subject_preg) {
                regfree(summaryview->simplify_subject_preg);
                g_free(summaryview->simplify_subject_preg);
@@ -7676,7 +7685,7 @@ void summary_set_prefs_from_folderitem(SummaryView *summaryview, FolderItem *ite
        if(item->prefs && item->prefs->simplify_subject_regexp && 
           item->prefs->simplify_subject_regexp[0] && item->prefs->enable_simplify_subject)
                summaryview->simplify_subject_preg = summary_compile_simplify_regexp(item->prefs->simplify_subject_regexp);
-
+#endif
        /* Sorting */
        sort_key = item->sort_key;
        sort_type = item->sort_type;