2007-12-06 [colin] 3.1.0cvs62
authorColin Leroy <colin@colino.net>
Thu, 6 Dec 2007 17:10:12 +0000 (17:10 +0000)
committerColin Leroy <colin@colino.net>
Thu, 6 Dec 2007 17:10:12 +0000 (17:10 +0000)
* src/account.c
* src/imap.c
* src/prefs_account.c
* src/prefs_account.h
* src/etpan/imap-thread.c
* src/etpan/imap-thread.h
Disable connection via command line on WIN32
Disable mmap use on WIN32 - use normal strings
* src/addressbook.c
* src/addressbook.h
* src/addressbook_foldersel.c
* src/addressbook_foldersel.h
* src/prefs_filtering_action.c
* src/prefs_matcher.c
* src/plugins/bogofilter/bogofilter_gtk.c
* src/plugins/dillo_viewer/dillo_prefs.c
* src/plugins/spamassassin/spamassassin_gtk.c
Fix leak, rework function logics to be more
natural - thanks to Holger
* src/common/utils.c
Fix warnings

19 files changed:
ChangeLog
PATCHSETS
configure.ac
src/account.c
src/addressbook.c
src/addressbook.h
src/addressbook_foldersel.c
src/addressbook_foldersel.h
src/common/utils.c
src/etpan/imap-thread.c
src/etpan/imap-thread.h
src/imap.c
src/plugins/bogofilter/bogofilter_gtk.c
src/plugins/dillo_viewer/dillo_prefs.c
src/plugins/spamassassin/spamassassin_gtk.c
src/prefs_account.c
src/prefs_account.h
src/prefs_filtering_action.c
src/prefs_matcher.c

index 9549dc5..85a3781 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,27 @@
+2007-12-06 [colin]     3.1.0cvs62
+
+       * src/account.c
+       * src/imap.c
+       * src/prefs_account.c
+       * src/prefs_account.h
+       * src/etpan/imap-thread.c
+       * src/etpan/imap-thread.h
+               Disable connection via command line on WIN32
+               Disable mmap use on WIN32 - use normal strings
+       * src/addressbook.c
+       * src/addressbook.h
+       * src/addressbook_foldersel.c
+       * src/addressbook_foldersel.h
+       * src/prefs_filtering_action.c
+       * src/prefs_matcher.c
+       * src/plugins/bogofilter/bogofilter_gtk.c
+       * src/plugins/dillo_viewer/dillo_prefs.c
+       * src/plugins/spamassassin/spamassassin_gtk.c
+               Fix leak, rework function logics to be more
+               natural - thanks to Holger
+       * src/common/utils.c
+               Fix warnings
+
 2007-12-06 [colin]     3.1.0cvs61
 
        * src/news.c
index c330277..d1708f4 100644 (file)
--- a/PATCHSETS
+++ b/PATCHSETS
 ( cvs diff -u -r 1.94.2.166 -r 1.94.2.167 src/messageview.c;  cvs diff -u -r 1.1.2.6 -r 1.1.2.7 src/uri_opener.c;  ) > 3.1.0cvs59.patchset
 ( cvs diff -u -r 1.101.2.47 -r 1.101.2.48 src/news.c;  ) > 3.1.0cvs60.patchset
 ( cvs diff -u -r 1.101.2.48 -r 1.101.2.49 src/news.c;  cvs diff -u -r 1.36.2.127 -r 1.36.2.128 src/common/utils.c;  cvs diff -u -r 1.20.2.56 -r 1.20.2.57 src/common/utils.h;  ) > 3.1.0cvs61.patchset
+( cvs diff -u -r 1.61.2.76 -r 1.61.2.77 src/account.c;  cvs diff -u -r 1.60.2.110 -r 1.60.2.111 src/addressbook.c;  cvs diff -u -r 1.18.2.12 -r 1.18.2.13 src/addressbook.h;  cvs diff -u -r 1.1.2.7 -r 1.1.2.8 src/addressbook_foldersel.c;  cvs diff -u -r 1.1.2.4 -r 1.1.2.5 src/addressbook_foldersel.h;  cvs diff -u -r 1.179.2.203 -r 1.179.2.204 src/imap.c;  cvs diff -u -r 1.105.2.118 -r 1.105.2.119 src/prefs_account.c;  cvs diff -u -r 1.49.2.35 -r 1.49.2.36 src/prefs_account.h;  cvs diff -u -r 1.1.4.44 -r 1.1.4.45 src/prefs_filtering_action.c;  cvs diff -u -r 1.43.2.66 -r 1.43.2.67 src/prefs_matcher.c;  cvs diff -u -r 1.36.2.128 -r 1.36.2.129 src/common/utils.c;  cvs diff -u -r 1.1.4.92 -r 1.1.4.93 src/etpan/imap-thread.c;  cvs diff -u -r 1.1.4.21 -r 1.1.4.22 src/etpan/imap-thread.h;  cvs diff -u -r 1.1.2.28 -r 1.1.2.29 src/plugins/bogofilter/bogofilter_gtk.c;  cvs diff -u -r 1.5.2.20 -r 1.5.2.21 src/plugins/dillo_viewer/dillo_prefs.c;  cvs diff -u -r 1.23.2.45 -r 1.23.2.46 src/plugins/spamassassin/spamassassin_gtk.c;  ) > 3.1.0cvs62.patchset
index 736cf80..d4ea3ec 100644 (file)
@@ -11,7 +11,7 @@ MINOR_VERSION=1
 MICRO_VERSION=0
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=61
+EXTRA_VERSION=62
 EXTRA_RELEASE=
 EXTRA_GTK2_VERSION=
 
index 5d9ae1d..d38970a 100644 (file)
@@ -1009,8 +1009,10 @@ static void account_clone(GtkWidget *widget, gpointer data)
         ACP_FASSIGN(mark_crosspost_read);
         ACP_FASSIGN(crosspost_col);
 
+#ifndef G_OS_WIN32
         ACP_FASSIGN(set_tunnelcmd);
         ACP_FDUP(tunnelcmd);
+#endif
 
         ACP_FDUP(imap_dir);
        ACP_FASSIGN(imap_subsonly);
index 11873e2..43fedc7 100644 (file)
@@ -4984,17 +4984,15 @@ gboolean addressbook_add_contact(
 /*
  * This function is used by the matcher dialog to select a book/folder.
  */
-gboolean addressbook_folder_selection( gchar **folderpath )
+gchar *addressbook_folder_selection( const gchar *folderpath)
 {
        AddressBookFile *book = NULL;
        ItemFolder *folder = NULL;
-       gchar *path;
+       gchar *path = NULL;
 
-       g_return_val_if_fail( folderpath != NULL, FALSE);
+       g_return_val_if_fail( folderpath != NULL, NULL);
 
-       path = *folderpath;
-       *folderpath = NULL;
-       if ( addressbook_foldersel_selection( _addressIndex_, &book, &folder, path )
+       if ( addressbook_foldersel_selection( _addressIndex_, &book, &folder, folderpath )
                && book != NULL ) {
                if ( folder != NULL) {
                        gchar *tmp = NULL;
@@ -5014,15 +5012,15 @@ gboolean addressbook_folder_selection( gchar **folderpath )
                                        g_free(oldtmp);
                                }
                        }
-                       *folderpath = g_strdup_printf("%s/%s", book->fileName, tmp);
+                       path = g_strdup_printf("%s/%s", book->fileName, tmp);
                        g_free(tmp);
                } else {
-                       *folderpath = g_strdup_printf("%s", book->fileName);
+                       path = g_strdup_printf("%s", book->fileName);
                }
-               debug_print( "addressbook_foldersel: %s\n", *folderpath?*folderpath:"(null)");
-               return (*folderpath != NULL);
+               debug_print( "addressbook_foldersel: %s\n", path?path:"(null)");
+               return path;
        }
-       return FALSE;
+       return NULL;
 }
 
 /* ***********************************************************************
index c79fe5c..e408ea8 100644 (file)
@@ -41,7 +41,7 @@ gboolean addressbook_add_contact      ( const gchar *name,
                                          const gchar *remarks,
                                          GdkPixbuf *picture );
                                          
-gboolean addressbook_folder_selection( gchar **folderpath );
+gchar *addressbook_folder_selection( const gchar *folderpath);
 gboolean addressbook_peek_folder_exists( gchar *folderpath,
                                                                                 AddressDataSource **book,
                                                                                 ItemFolder **folder );
index e365e0a..c2976db 100644 (file)
@@ -292,7 +292,8 @@ static void addressbook_foldersel_load_folder( GtkCTreeNode *parentNode, ItemFol
        }
 }
 
-static void addressbook_foldersel_load_data( AddressIndex *addrIndex, gchar *path, FolderPathMatch* match )
+static void addressbook_foldersel_load_data( AddressIndex *addrIndex, 
+                                            FolderPathMatch* match )
 {
        AddressDataSource *ds;
        GList *list, *nodeDS;
@@ -367,7 +368,8 @@ static void addressbook_foldersel_load_data( AddressIndex *addrIndex, gchar *pat
 }
 
 gboolean addressbook_foldersel_selection( AddressIndex *addrIndex,
-                                       AddressBookFile **book, ItemFolder **folder, gchar* path)
+                                       AddressBookFile **book, ItemFolder **folder, 
+                                       const gchar* path)
 {
        FolderPathMatch folder_path_match = { NULL, FALSE, 0, NULL };
        gboolean retVal = FALSE;
@@ -393,7 +395,7 @@ gboolean addressbook_foldersel_selection( AddressIndex *addrIndex,
                        folder_path_match.folder_path = g_strsplit( path, "/", 256 );
        }
 
-       addressbook_foldersel_load_data( addrIndex, path, &folder_path_match );
+       addressbook_foldersel_load_data( addrIndex, &folder_path_match );
 
        if ( folder_path_match.folder_path != NULL && folder_path_match.matched == FALSE)
                g_warning("addressbook_foldersel_load_data: couldn't match book/folder path '%s'\n", path);
index 6c46521..0349c61 100644 (file)
@@ -27,6 +27,7 @@
 #include "addrindex.h"
 
 gboolean addressbook_foldersel_selection( AddressIndex *addrIndex,
-                               AddressBookFile **book, ItemFolder **folder, gchar *path );
+                               AddressBookFile **book, ItemFolder **folder, 
+                               const gchar *path );
 
 #endif /* __ADDRESSBOOK_FOLDERSEL_H__ */
index 2915498..a93cb49 100644 (file)
@@ -3085,20 +3085,20 @@ static gchar *file_read_to_str_full(const gchar *file, gboolean recode)
 
 gchar *file_read_to_str(const gchar *file)
 {
-       file_read_to_str_full(file, TRUE);
+       return file_read_to_str_full(file, TRUE);
 }
 gchar *file_read_stream_to_str(FILE *fp)
 {
-       file_read_stream_to_str_full(fp, TRUE);
+       return file_read_stream_to_str_full(fp, TRUE);
 }
 
 gchar *file_read_to_str_no_recode(const gchar *file)
 {
-       file_read_to_str_full(file, FALSE);
+       return file_read_to_str_full(file, FALSE);
 }
 gchar *file_read_stream_to_str_no_recode(FILE *fp)
 {
-       file_read_stream_to_str_full(fp, FALSE);
+       return file_read_stream_to_str_full(fp, FALSE);
 }
 
 char *fgets_crlf(char *buf, int size, FILE *stream)
index 1ab4906..20b0e2a 100644 (file)
@@ -2348,6 +2348,8 @@ static void fetch_content_run(struct etpan_thread_op * op)
                g_unlink(param->filename);
        
        free:
+               /* mmap_string_unref is a simple free in libetpan
+                * when it has MMAP_UNAVAILABLE defined */
                if (mmap_string_unref(content) != 0)
                        free(content);
        }
@@ -2780,8 +2782,10 @@ static void append_run(struct etpan_thread_op * op)
        int r;
        char * data;
        size_t size;
+#ifndef G_OS_WIN32
        struct stat stat_buf;
        int fd;
+#endif
        guint32 uid = 0, val = 0;
        
        param = op->param;
@@ -2789,6 +2793,7 @@ static void append_run(struct etpan_thread_op * op)
        
        CHECK_IMAP();
 
+#ifndef G_OS_WIN32
        r = stat(param->filename, &stat_buf);
        if (r < 0) {
                result->error = MAILIMAP_ERROR_APPEND;
@@ -2808,7 +2813,14 @@ static void append_run(struct etpan_thread_op * op)
                result->error = MAILIMAP_ERROR_APPEND;
                return;
        }
-       
+#else
+       data = file_read_to_str_no_recode(param->filename);
+       if (data == NULL) {
+               result->error = MAILIMAP_ERROR_APPEND;
+               return;
+       }
+       size = strlen(data);
+#endif
        mailstream_logger = imap_logger_append;
        
        r = mailimap_uidplus_append(param->imap, param->mailbox,
@@ -2817,8 +2829,12 @@ static void append_run(struct etpan_thread_op * op)
 
        mailstream_logger = imap_logger_cmd;
        
+#ifndef G_OS_WIN32
        munmap(data, size);
        close(fd);
+#else
+       g_free(data);
+#endif
        
        result->error = r;
        result->uid = uid;
@@ -3025,7 +3041,7 @@ int imap_threaded_store(Folder * folder, struct mailimap_set * set,
 
 
 #define ENV_BUFFER_SIZE 512
-
+#ifndef G_OS_WIN32
 static void do_exec_command(int fd, const char * command,
                            const char * servername, uint16_t port)
 {
@@ -3224,6 +3240,7 @@ int imap_threaded_connect_cmd(Folder * folder, const char * command,
        
        return result.error;
 }
+#endif /* G_OS_WIN32 */
 
 void imap_threaded_cancel(Folder * folder)
 {
index 88d4ded..eae204f 100644 (file)
@@ -36,9 +36,11 @@ void imap_done(Folder * folder);
 int imap_threaded_connect(Folder * folder, const char * server, int port);
 int imap_threaded_connect_ssl(Folder * folder, const char * server, int port);
 struct mailimap_capability_data * imap_threaded_capability(Folder *folder, int *ok);
+
+#ifndef G_OS_WIN32
 int imap_threaded_connect_cmd(Folder * folder, const char * command,
                              const char * server, int port);
-
+#endif
 void imap_threaded_disconnect(Folder * folder);
 
 int imap_threaded_list(Folder * folder, const char * base,
index 20409fd..b57e5ca 100644 (file)
@@ -1042,13 +1042,16 @@ static IMAPSession *imap_session_new(Folder * folder,
 
        imap_init(folder);
        statuswindow_print_all(_("Connecting to IMAP4 server: %s..."), folder->account->recv_server);
+#ifndef G_OS_WIN32
        if (account->set_tunnelcmd) {
                r = imap_threaded_connect_cmd(folder,
                                              account->tunnelcmd,
                                              account->recv_server,
                                              port);
        }
-       else {
+       else 
+#endif
+       {
 #if (defined(USE_OPENSSL) || defined (USE_GNUTLS))
                if (ssl_type == SSL_TUNNEL) {
                        r = imap_threaded_connect_ssl(folder,
index b5ef049..a52c52b 100644 (file)
@@ -80,13 +80,15 @@ static void foldersel_cb(GtkWidget *widget, gpointer data)
 static void bogofilter_whitelist_ab_select_cb(GtkWidget *widget, gpointer data)
 {
        struct BogofilterPage *page = (struct BogofilterPage *) data;
-       gchar *folderpath = NULL;
-       gboolean ret = FALSE;
-
-       folderpath = (gchar *) gtk_entry_get_text(GTK_ENTRY(GTK_BIN(page->whitelist_ab_folder_combo)->child));
-       ret = addressbook_folder_selection(&folderpath);
-       if ( ret != FALSE && folderpath != NULL)
-               gtk_entry_set_text(GTK_ENTRY(GTK_BIN(page->whitelist_ab_folder_combo)->child), folderpath);
+       const gchar *folderpath = NULL;
+       gchar *new_path = NULL;
+
+       folderpath = gtk_entry_get_text(GTK_ENTRY(GTK_BIN(page->whitelist_ab_folder_combo)->child));
+       new_path = addressbook_folder_selection(folderpath);
+       if (new_path) {
+               gtk_entry_set_text(GTK_ENTRY(GTK_BIN(page->whitelist_ab_folder_combo)->child), new_path);
+               g_free(new_path);
+       } 
 }
 
 static void bogofilter_create_widget_func(PrefsPage * _page,
index d3d3633..3763ae1 100644 (file)
@@ -80,13 +80,15 @@ static void save_dillo_prefs                (PrefsPage *page);
 static void dillo_whitelist_ab_select_cb(GtkWidget *widget, gpointer data)
 {
        DilloBrowserPage *page = (DilloBrowserPage *) data;
-       gchar *folderpath = NULL;
-       gboolean ret = FALSE;
-
-       folderpath = (gchar *) gtk_entry_get_text(GTK_ENTRY(GTK_BIN(page->whitelist_ab_folder_combo)->child));
-       ret = addressbook_folder_selection(&folderpath);
-       if ( ret != FALSE && folderpath != NULL)
-               gtk_entry_set_text(GTK_ENTRY(GTK_BIN(page->whitelist_ab_folder_combo)->child), folderpath);
+       const gchar *folderpath = NULL;
+       gchar *new_path = NULL;
+
+       folderpath = gtk_entry_get_text(GTK_ENTRY(GTK_BIN(page->whitelist_ab_folder_combo)->child));
+       new_path = addressbook_folder_selection(folderpath);
+       if (new_path) {
+               gtk_entry_set_text(GTK_ENTRY(GTK_BIN(page->whitelist_ab_folder_combo)->child), new_path);
+               g_free(new_path);
+       } 
 }
 
 static void local_checkbox_toggled(GtkToggleButton *button,
index f7996d2..0903d85 100644 (file)
@@ -95,13 +95,15 @@ struct Transport transports[] = {
 static void spamassassin_whitelist_ab_select_cb(GtkWidget *widget, gpointer data)
 {
        struct SpamAssassinPage *page = (struct SpamAssassinPage *) data;
-       gchar *folderpath = NULL;
-       gboolean ret = FALSE;
-
-       folderpath = (gchar *) gtk_entry_get_text(GTK_ENTRY(GTK_BIN(page->whitelist_ab_folder_combo)->child));
-       ret = addressbook_folder_selection(&folderpath);
-       if ( ret != FALSE && folderpath != NULL)
-               gtk_entry_set_text(GTK_ENTRY(GTK_BIN(page->whitelist_ab_folder_combo)->child), folderpath);
+       const gchar *folderpath = NULL;
+       gchar *new_path = NULL;
+
+       folderpath = gtk_entry_get_text(GTK_ENTRY(GTK_BIN(page->whitelist_ab_folder_combo)->child));
+       new_path = addressbook_folder_selection(folderpath);
+       if (new_path) {
+               gtk_entry_set_text(GTK_ENTRY(GTK_BIN(page->whitelist_ab_folder_combo)->child), new_path);
+               g_free(new_path);
+       } 
 }
 
 static void foldersel_cb(GtkWidget *widget, gpointer data)
index 74719dd..9def1b4 100644 (file)
@@ -268,8 +268,10 @@ typedef struct AdvancedPage
        GtkWidget *crosspost_checkbtn;
        GtkWidget *crosspost_colormenu;
 
+#ifndef G_OS_WIN32
        GtkWidget *tunnelcmd_checkbtn;
        GtkWidget *tunnelcmd_entry;
+#endif
 
        GtkWidget *sent_folder_checkbtn;
        GtkWidget *sent_folder_entry;
@@ -739,7 +741,7 @@ static PrefParam advanced_param[] = {
        {"domain", NULL, &tmp_ac_prefs.domain, P_STRING,
         &advanced_page.domain_entry,
         prefs_set_data_from_entry, prefs_set_entry},
-
+#ifndef G_OS_WIN32
        {"set_tunnelcmd", "FALSE", &tmp_ac_prefs.set_tunnelcmd, P_BOOL,
         &advanced_page.tunnelcmd_checkbtn,
         prefs_set_data_from_toggle, prefs_set_toggle},
@@ -747,7 +749,7 @@ static PrefParam advanced_param[] = {
        {"tunnelcmd", NULL, &tmp_ac_prefs.tunnelcmd, P_STRING,
         &advanced_page.tunnelcmd_entry,
         prefs_set_data_from_entry, prefs_set_entry},
-
+#endif
        {"mark_crosspost_read", "FALSE", &tmp_ac_prefs.mark_crosspost_read, P_BOOL,
         &advanced_page.crosspost_checkbtn,
         prefs_set_data_from_toggle, prefs_set_toggle},
@@ -2395,8 +2397,10 @@ static void advanced_create_widget_func(PrefsPage * _page,
        GtkWidget *checkbtn_crosspost;
        GtkWidget *colormenu_crosspost;
        GtkWidget *menu;
+#ifndef G_OS_WIN32
        GtkWidget *checkbtn_tunnelcmd;
        GtkWidget *entry_tunnelcmd;
+#endif
        GtkWidget *folder_frame;
        GtkWidget *vbox3;
        GtkWidget *table;
@@ -2476,7 +2480,7 @@ static void advanced_create_widget_func(PrefsPage * _page,
                             NULL);
 
 
-       
+#ifndef G_OS_WIN32     
        PACK_HBOX (hbox1);
        PACK_CHECK_BUTTON (hbox1, checkbtn_tunnelcmd,
                           _("Use command to communicate with server"));
@@ -2484,7 +2488,7 @@ static void advanced_create_widget_func(PrefsPage * _page,
        gtk_widget_show (entry_tunnelcmd);
        gtk_box_pack_start (GTK_BOX (hbox1), entry_tunnelcmd, TRUE, TRUE, 0);
        SET_TOGGLE_SENSITIVITY (checkbtn_tunnelcmd, entry_tunnelcmd);
-
+#endif
        PACK_HBOX (hbox1);
        PACK_CHECK_BUTTON (hbox1, checkbtn_crosspost, 
                           _("Mark cross-posted messages as read and color:"));
@@ -2567,9 +2571,10 @@ static void advanced_create_widget_func(PrefsPage * _page,
        page->crosspost_checkbtn        = checkbtn_crosspost;
        page->crosspost_colormenu       = colormenu_crosspost;
 
+#ifndef G_OS_WIN32
        page->tunnelcmd_checkbtn        = checkbtn_tunnelcmd;
        page->tunnelcmd_entry   = entry_tunnelcmd;
-
+#endif
        page->sent_folder_checkbtn  = sent_folder_checkbtn;
        page->sent_folder_entry   = sent_folder_entry;
        page->queue_folder_checkbtn  = queue_folder_checkbtn;
@@ -3826,8 +3831,10 @@ static void prefs_account_protocol_changed(GtkComboBox *combobox, gpointer data)
                gtk_widget_show(advanced_page.nntpport_hbox);
                gtk_widget_show(advanced_page.crosspost_checkbtn);
                gtk_widget_show(advanced_page.crosspost_colormenu);
+#ifndef G_OS_WIN32
                gtk_widget_hide(advanced_page.tunnelcmd_checkbtn);
                gtk_widget_hide(advanced_page.tunnelcmd_entry);
+#endif
                gtk_widget_hide(receive_page.imapdir_label);
                gtk_widget_hide(receive_page.imapdir_entry);
                gtk_widget_hide(receive_page.subsonly_checkbtn);
@@ -3918,8 +3925,10 @@ static void prefs_account_protocol_changed(GtkComboBox *combobox, gpointer data)
                gtk_widget_hide(advanced_page.nntpport_hbox);
                gtk_widget_hide(advanced_page.crosspost_checkbtn);
                gtk_widget_hide(advanced_page.crosspost_colormenu);
+#ifndef G_OS_WIN32
                gtk_widget_hide(advanced_page.tunnelcmd_checkbtn);
                gtk_widget_hide(advanced_page.tunnelcmd_entry);
+#endif
                gtk_widget_hide(receive_page.imapdir_label);
                gtk_widget_hide(receive_page.imapdir_entry);
                gtk_widget_hide(receive_page.subsonly_checkbtn);
@@ -4019,8 +4028,10 @@ static void prefs_account_protocol_changed(GtkComboBox *combobox, gpointer data)
                gtk_widget_hide(advanced_page.nntpport_hbox);
                gtk_widget_hide(advanced_page.crosspost_checkbtn);
                gtk_widget_hide(advanced_page.crosspost_colormenu);
+#ifndef G_OS_WIN32
                gtk_widget_show(advanced_page.tunnelcmd_checkbtn);
                gtk_widget_show(advanced_page.tunnelcmd_entry);
+#endif
                gtk_widget_show(receive_page.imapdir_label);
                gtk_widget_show(receive_page.imapdir_entry);
                gtk_widget_show(receive_page.subsonly_checkbtn);
@@ -4109,8 +4120,10 @@ static void prefs_account_protocol_changed(GtkComboBox *combobox, gpointer data)
                gtk_widget_hide(advanced_page.nntpport_hbox);
                gtk_widget_hide(advanced_page.crosspost_checkbtn);
                gtk_widget_hide(advanced_page.crosspost_colormenu);
+#ifndef G_OS_WIN32
                gtk_widget_hide(advanced_page.tunnelcmd_checkbtn);
                gtk_widget_hide(advanced_page.tunnelcmd_entry);
+#endif
                gtk_widget_hide(receive_page.imapdir_label);
                gtk_widget_hide(receive_page.imapdir_entry);
                gtk_widget_hide(receive_page.subsonly_checkbtn);
@@ -4205,8 +4218,10 @@ static void prefs_account_protocol_changed(GtkComboBox *combobox, gpointer data)
                gtk_widget_hide(advanced_page.nntpport_hbox);
                gtk_widget_hide(advanced_page.crosspost_checkbtn);
                gtk_widget_hide(advanced_page.crosspost_colormenu);
+#ifndef G_OS_WIN32
                gtk_widget_hide(advanced_page.tunnelcmd_checkbtn);
                gtk_widget_hide(advanced_page.tunnelcmd_entry);
+#endif
                gtk_widget_hide(receive_page.imapdir_label);
                gtk_widget_hide(receive_page.imapdir_entry);
                gtk_widget_hide(receive_page.subsonly_checkbtn);
index 1dd3c03..e8e793b 100644 (file)
@@ -163,6 +163,7 @@ struct _PrefsAccount
        gboolean  mark_crosspost_read;
        gint      crosspost_col;
 
+#ifndef G_OS_WIN32
        /* Use this command to open a socket, rather than doing so
         * directly.  Good if you want to perhaps use a special socks
         * tunnel command, or run IMAP-over-SSH.  In this case the
@@ -173,6 +174,7 @@ struct _PrefsAccount
         * as a particular user. */
        gboolean  set_tunnelcmd;
        gchar     *tunnelcmd;
+#endif
 
        gchar *imap_dir;
        gboolean imap_subsonly;
index c208e5a..1098d0e 100644 (file)
@@ -1210,16 +1210,15 @@ static void prefs_filtering_action_select_dest(void)
 
 static void prefs_filtering_action_select_addressbook(void)
 {
-       gchar *folderpath = NULL;
-       gchar *prev = NULL;
-       gboolean ret = FALSE;
-
-       prev = g_strdup(gtk_editable_get_chars(GTK_EDITABLE(filtering_action.dest_entry), 0, -1));
-       folderpath = prev;
-       ret = addressbook_folder_selection(&folderpath);
-       if ( ret != FALSE && folderpath != NULL)
-               gtk_entry_set_text(GTK_ENTRY(filtering_action.dest_entry), folderpath);
-       g_free(prev);
+       const gchar *folderpath = NULL;
+       gchar *new_path = NULL;
+
+       folderpath = gtk_entry_get_text(GTK_ENTRY(filtering_action.dest_entry));
+       new_path = addressbook_folder_selection(folderpath);
+       if (new_path) {
+               gtk_entry_set_text(GTK_ENTRY(filtering_action.dest_entry), new_path);
+               g_free(new_path);
+       } 
 }
 
 static void prefs_filtering_action_type_selection_changed(GtkWidget *combo,
index 10d499c..f52926c 100644 (file)
@@ -1321,7 +1321,7 @@ static MatcherProp *prefs_matcher_dialog_to_matcher(void)
        gint value, sel;
 
        if (value_criteria == -1)
-               return -1;
+               return NULL;
 
        criteria = prefs_matcher_get_matching_from_criteria(value_criteria);
 
@@ -2020,13 +2020,15 @@ static void prefs_matcher_test_info(void)
 
 static void prefs_matcher_addressbook_select(void)
 {
-       gchar *folderpath = NULL;
-       gboolean ret = FALSE;
-
-       folderpath = (gchar *) gtk_entry_get_text(GTK_ENTRY(GTK_BIN(matcher.addressbook_folder_combo)->child));
-       ret = addressbook_folder_selection(&folderpath);
-       if ( ret != FALSE && folderpath != NULL)
-               gtk_entry_set_text(GTK_ENTRY(GTK_BIN(matcher.addressbook_folder_combo)->child), folderpath);
+       const gchar *folderpath = NULL;
+       gchar *new_path = NULL;
+
+       folderpath = gtk_entry_get_text(GTK_ENTRY(GTK_BIN(matcher.addressbook_folder_combo)->child));
+       new_path = addressbook_folder_selection(folderpath);
+       if (new_path) {
+               gtk_entry_set_text(GTK_ENTRY(GTK_BIN(matcher.addressbook_folder_combo)->child), new_path);
+               g_free(new_path);
+       } 
 }