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 9549dc5413abffdbabf3c4d790bcc7984b8a7d7a..85a37812be3721f750ae0619b713c665407aae22 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
 2007-12-06 [colin]     3.1.0cvs61
 
        * src/news.c
index c33027705093635ac56c3be93762f597552afbd9..d1708f477b37581cd549fa2a1bfd8cdb0bb095a8 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.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 736cf806046a76659fe4ae0089545984e73a50a8..d4ea3ecb2379f19a056abc589f6230be5275005e 100644 (file)
@@ -11,7 +11,7 @@ MINOR_VERSION=1
 MICRO_VERSION=0
 INTERFACE_AGE=0
 BINARY_AGE=0
 MICRO_VERSION=0
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=61
+EXTRA_VERSION=62
 EXTRA_RELEASE=
 EXTRA_GTK2_VERSION=
 
 EXTRA_RELEASE=
 EXTRA_GTK2_VERSION=
 
index 5d9ae1d786b752cbea6d97d217a8772a14a0e97d..d38970a588e044e969025bb08f01219d14570f88 100644 (file)
@@ -1009,8 +1009,10 @@ static void account_clone(GtkWidget *widget, gpointer data)
         ACP_FASSIGN(mark_crosspost_read);
         ACP_FASSIGN(crosspost_col);
 
         ACP_FASSIGN(mark_crosspost_read);
         ACP_FASSIGN(crosspost_col);
 
+#ifndef G_OS_WIN32
         ACP_FASSIGN(set_tunnelcmd);
         ACP_FDUP(tunnelcmd);
         ACP_FASSIGN(set_tunnelcmd);
         ACP_FDUP(tunnelcmd);
+#endif
 
         ACP_FDUP(imap_dir);
        ACP_FASSIGN(imap_subsonly);
 
         ACP_FDUP(imap_dir);
        ACP_FASSIGN(imap_subsonly);
index 11873e29a3899ccb8abf62aafccecff1e37fb66f..43fedc7c81281e4577312cc96e82e1e84622fe23 100644 (file)
@@ -4984,17 +4984,15 @@ gboolean addressbook_add_contact(
 /*
  * This function is used by the matcher dialog to select a book/folder.
  */
 /*
  * 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;
 {
        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;
                && book != NULL ) {
                if ( folder != NULL) {
                        gchar *tmp = NULL;
@@ -5014,15 +5012,15 @@ gboolean addressbook_folder_selection( gchar **folderpath )
                                        g_free(oldtmp);
                                }
                        }
                                        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 {
                        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 c79fe5cb1ef9260dca9a41036708977527289ff9..e408ea834cc01ea42436515372b6e98cf9fc6e87 100644 (file)
@@ -41,7 +41,7 @@ gboolean addressbook_add_contact      ( const gchar *name,
                                          const gchar *remarks,
                                          GdkPixbuf *picture );
                                          
                                          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 );
 gboolean addressbook_peek_folder_exists( gchar *folderpath,
                                                                                 AddressDataSource **book,
                                                                                 ItemFolder **folder );
index e365e0adc75c2d9ccf76cb823e6b7fe4eb75d71f..c2976dbeb27c64383bbaa5e98c665ce135f50ddb 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;
 {
        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,
 }
 
 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;
 {
        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 );
        }
 
                        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);
 
        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 6c46521306c3b5d9f3957e9aed42ef24821d66bc..0349c61668c0e97b969fce12225c9b59c75349ba 100644 (file)
@@ -27,6 +27,7 @@
 #include "addrindex.h"
 
 gboolean addressbook_foldersel_selection( AddressIndex *addrIndex,
 #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__ */
 
 #endif /* __ADDRESSBOOK_FOLDERSEL_H__ */
index 2915498e108e359860e70060a399b3d9426ecd92..a93cb49dcd053b5d53ef184669dfa5773d7e30cd 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)
 {
 
 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)
 {
 }
 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)
 {
 }
 
 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)
 {
 }
 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)
 }
 
 char *fgets_crlf(char *buf, int size, FILE *stream)
index 1ab49062bbff96dd93aaf05c0a80bfbb82e7fa05..20b0e2a99ca2b63ff1441816c17c9cb55d4035d2 100644 (file)
@@ -2348,6 +2348,8 @@ static void fetch_content_run(struct etpan_thread_op * op)
                g_unlink(param->filename);
        
        free:
                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);
        }
                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;
        int r;
        char * data;
        size_t size;
+#ifndef G_OS_WIN32
        struct stat stat_buf;
        int fd;
        struct stat stat_buf;
        int fd;
+#endif
        guint32 uid = 0, val = 0;
        
        param = op->param;
        guint32 uid = 0, val = 0;
        
        param = op->param;
@@ -2789,6 +2793,7 @@ static void append_run(struct etpan_thread_op * op)
        
        CHECK_IMAP();
 
        
        CHECK_IMAP();
 
+#ifndef G_OS_WIN32
        r = stat(param->filename, &stat_buf);
        if (r < 0) {
                result->error = MAILIMAP_ERROR_APPEND;
        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;
        }
                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,
        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;
        
 
        mailstream_logger = imap_logger_cmd;
        
+#ifndef G_OS_WIN32
        munmap(data, size);
        close(fd);
        munmap(data, size);
        close(fd);
+#else
+       g_free(data);
+#endif
        
        result->error = r;
        result->uid = uid;
        
        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
 
 
 #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)
 {
 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;
 }
        
        return result.error;
 }
+#endif /* G_OS_WIN32 */
 
 void imap_threaded_cancel(Folder * folder)
 {
 
 void imap_threaded_cancel(Folder * folder)
 {
index 88d4ded6017a2f11ad781db6a45acd0fd3d608fe..eae204ff60681e7af695f4903935922465e27fb2 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);
 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);
 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,
 void imap_threaded_disconnect(Folder * folder);
 
 int imap_threaded_list(Folder * folder, const char * base,
index 20409fdca74a42db3351c3303e1248c089e80e4a..b57e5ca1dab85ccce3ce379fbd962c54527265e2 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);
 
        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);
        }
        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,
 #if (defined(USE_OPENSSL) || defined (USE_GNUTLS))
                if (ssl_type == SSL_TUNNEL) {
                        r = imap_threaded_connect_ssl(folder,
index b5ef049c0636497bf880b16cb3c369e5e37687a0..a52c52be2e826719905fe99ac30b57efc9bb0ae6 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;
 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,
 }
 
 static void bogofilter_create_widget_func(PrefsPage * _page,
index d3d3633c5205284894e92925377009129ec25d64..3763ae169bdb8e46de0771901e304ea64e87c904 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;
 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,
 }
 
 static void local_checkbox_toggled(GtkToggleButton *button,
index f7996d271c91edf7d47cf16abc9a0522155c128e..0903d85ce68bdb88467babfbadf284056eb3d930 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;
 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)
 }
 
 static void foldersel_cb(GtkWidget *widget, gpointer data)
index 74719dda96603469bcd8492e894d81d5069e0089..9def1b443310186b6f038da64a7861e8f73b1c5c 100644 (file)
@@ -268,8 +268,10 @@ typedef struct AdvancedPage
        GtkWidget *crosspost_checkbtn;
        GtkWidget *crosspost_colormenu;
 
        GtkWidget *crosspost_checkbtn;
        GtkWidget *crosspost_colormenu;
 
+#ifndef G_OS_WIN32
        GtkWidget *tunnelcmd_checkbtn;
        GtkWidget *tunnelcmd_entry;
        GtkWidget *tunnelcmd_checkbtn;
        GtkWidget *tunnelcmd_entry;
+#endif
 
        GtkWidget *sent_folder_checkbtn;
        GtkWidget *sent_folder_entry;
 
        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},
        {"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},
        {"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},
        {"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},
        {"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;
        GtkWidget *checkbtn_crosspost;
        GtkWidget *colormenu_crosspost;
        GtkWidget *menu;
+#ifndef G_OS_WIN32
        GtkWidget *checkbtn_tunnelcmd;
        GtkWidget *entry_tunnelcmd;
        GtkWidget *checkbtn_tunnelcmd;
        GtkWidget *entry_tunnelcmd;
+#endif
        GtkWidget *folder_frame;
        GtkWidget *vbox3;
        GtkWidget *table;
        GtkWidget *folder_frame;
        GtkWidget *vbox3;
        GtkWidget *table;
@@ -2476,7 +2480,7 @@ static void advanced_create_widget_func(PrefsPage * _page,
                             NULL);
 
 
                             NULL);
 
 
-       
+#ifndef G_OS_WIN32     
        PACK_HBOX (hbox1);
        PACK_CHECK_BUTTON (hbox1, checkbtn_tunnelcmd,
                           _("Use command to communicate with server"));
        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);
        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:"));
        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;
 
        page->crosspost_checkbtn        = checkbtn_crosspost;
        page->crosspost_colormenu       = colormenu_crosspost;
 
+#ifndef G_OS_WIN32
        page->tunnelcmd_checkbtn        = checkbtn_tunnelcmd;
        page->tunnelcmd_entry   = entry_tunnelcmd;
        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;
        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);
                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);
                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);
                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);
                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);
                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);
                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);
                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);
                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);
                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);
                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);
                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);
                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);
                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);
                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);
                gtk_widget_hide(receive_page.imapdir_label);
                gtk_widget_hide(receive_page.imapdir_entry);
                gtk_widget_hide(receive_page.subsonly_checkbtn);
index 1dd3c034947797cc472e14d4439854404bb24235..e8e793bd056d5cb551f147d7c537d0798e42597f 100644 (file)
@@ -163,6 +163,7 @@ struct _PrefsAccount
        gboolean  mark_crosspost_read;
        gint      crosspost_col;
 
        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
        /* 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;
         * as a particular user. */
        gboolean  set_tunnelcmd;
        gchar     *tunnelcmd;
+#endif
 
        gchar *imap_dir;
        gboolean imap_subsonly;
 
        gchar *imap_dir;
        gboolean imap_subsonly;
index c208e5a917e9e7b700ada5913ae45b6d649d6ec5..1098d0ed36c44ae5d3f618fc9a6af05f44738966 100644 (file)
@@ -1210,16 +1210,15 @@ static void prefs_filtering_action_select_dest(void)
 
 static void prefs_filtering_action_select_addressbook(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,
 }
 
 static void prefs_filtering_action_type_selection_changed(GtkWidget *combo,
index 10d499c02ef29db3af173484b87988d47e91e5a0..f52926c4206993076154b9167ba35d23c7d10a33 100644 (file)
@@ -1321,7 +1321,7 @@ static MatcherProp *prefs_matcher_dialog_to_matcher(void)
        gint value, sel;
 
        if (value_criteria == -1)
        gint value, sel;
 
        if (value_criteria == -1)
-               return -1;
+               return NULL;
 
        criteria = prefs_matcher_get_matching_from_criteria(value_criteria);
 
 
        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)
 {
 
 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);
+       } 
 }
 
 
 }