2009-01-17 [colin] 3.7.0cvs37
authorColin Leroy <colin@colino.net>
Sat, 17 Jan 2009 16:24:32 +0000 (16:24 +0000)
committerColin Leroy <colin@colino.net>
Sat, 17 Jan 2009 16:24:32 +0000 (16:24 +0000)
* src/addressbook.c
* src/compose.c
* src/foldersel.c
* src/main.c
* src/mainwindow.c
* src/mbox.c
* src/common/md5.c
* src/common/ssl_certificate.c
* src/common/tags.c
* src/common/utils.c
* src/etpan/imap-thread.c
* src/plugins/bogofilter/bogofilter.c
* src/plugins/pgpinline/pgpinline.c
* src/plugins/smime/smime.c
Probably fix bug 1825, 'Unable to fetch messages from
IMAP folders named with non-ASCII string'
Change remaining occurences of fopen and open with
g_fopen and g_open

17 files changed:
ChangeLog
PATCHSETS
configure.ac
src/addressbook.c
src/common/md5.c
src/common/ssl_certificate.c
src/common/tags.c
src/common/utils.c
src/compose.c
src/etpan/imap-thread.c
src/foldersel.c
src/main.c
src/mainwindow.c
src/mbox.c
src/plugins/bogofilter/bogofilter.c
src/plugins/pgpinline/pgpinline.c
src/plugins/smime/smime.c

index 7cf4d5985941a3ae9f3f492e91956ea1636d323d..93e729c92dda8c807e5909e2fc0325f7ea923194 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,24 @@
+2009-01-17 [colin]     3.7.0cvs37
+
+       * src/addressbook.c
+       * src/compose.c
+       * src/foldersel.c
+       * src/main.c
+       * src/mainwindow.c
+       * src/mbox.c
+       * src/common/md5.c
+       * src/common/ssl_certificate.c
+       * src/common/tags.c
+       * src/common/utils.c
+       * src/etpan/imap-thread.c
+       * src/plugins/bogofilter/bogofilter.c
+       * src/plugins/pgpinline/pgpinline.c
+       * src/plugins/smime/smime.c
+               Probably fix bug 1825, 'Unable to fetch messages from 
+               IMAP folders named with non-ASCII string'
+               Change remaining occurences of fopen and open with
+               g_fopen and g_open
+
 2009-01-17 [paul]      3.7.0cvs36
 
        * manual/faq.xml
index 930892b9ce0357c85c8cfae7b193566c5f10fefb..fff6954205966ea2c262a136775cc573ee620d46 100644 (file)
--- a/PATCHSETS
+++ b/PATCHSETS
 ( cvs diff -u -r 1.60.2.55 -r 1.60.2.56 po/es.po;  ) > 3.7.0cvs34.patchset
 ( cvs diff -u -r 1.52.2.72 -r 1.52.2.73 src/prefs_folder_item.c;  ) > 3.7.0cvs35.patchset
 ( cvs diff -u -r 1.1.2.18 -r 1.1.2.19 manual/faq.xml;  ) > 3.7.0cvs36.patchset
+( cvs diff -u -r 1.60.2.128 -r 1.60.2.129 src/addressbook.c;  cvs diff -u -r 1.382.2.494 -r 1.382.2.495 src/compose.c;  cvs diff -u -r 1.26.2.41 -r 1.26.2.42 src/foldersel.c;  cvs diff -u -r 1.115.2.218 -r 1.115.2.219 src/main.c;  cvs diff -u -r 1.274.2.295 -r 1.274.2.296 src/mainwindow.c;  cvs diff -u -r 1.28.2.44 -r 1.28.2.45 src/mbox.c;  cvs diff -u -r 1.2.2.6 -r 1.2.2.7 src/common/md5.c;  cvs diff -u -r 1.4.2.35 -r 1.4.2.36 src/common/ssl_certificate.c;  cvs diff -u -r 1.1.2.9 -r 1.1.2.10 src/common/tags.c;  cvs diff -u -r 1.36.2.163 -r 1.36.2.164 src/common/utils.c;  cvs diff -u -r 1.1.4.107 -r 1.1.4.108 src/etpan/imap-thread.c;  cvs diff -u -r 1.1.2.39 -r 1.1.2.40 src/plugins/bogofilter/bogofilter.c;  cvs diff -u -r 1.1.2.42 -r 1.1.2.43 src/plugins/pgpinline/pgpinline.c;  cvs diff -u -r 1.1.2.3 -r 1.1.2.4 src/plugins/smime/smime.c;  ) > 3.7.0cvs37.patchset
index b2db3b7f130ea21a2f19aa3765ed6b24d5ab4a69..26dcf5c8e1f7228e41bfb50416f6aebe5b8d469d 100644 (file)
@@ -11,7 +11,7 @@ MINOR_VERSION=7
 MICRO_VERSION=0
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=36
+EXTRA_VERSION=37
 EXTRA_RELEASE=
 EXTRA_GTK2_VERSION=
 
index 622957b961c4ad7b8088464a3cb13a830fb262f4..4e9fe38bb792d23de646d90299d1e7cb86b80b19 100644 (file)
@@ -132,17 +132,17 @@ static gchar *list_titles[] = { N_("Name"),
 
 #define ADDRESSBOOK_MSGBUF_SIZE 2048
 
-static GdkPixbuf *folderxpm;
-static GdkPixbuf *folderopenxpm;
-static GdkPixbuf *groupxpm;
-static GdkPixbuf *interfacexpm;
-static GdkPixbuf *bookxpm;
-static GdkPixbuf *addressxpm;
-static GdkPixbuf *vcardxpm;
-static GdkPixbuf *jpilotxpm;
-static GdkPixbuf *categoryxpm;
-static GdkPixbuf *ldapxpm;
-static GdkPixbuf *addrsearchxpm;
+static GdkPixbuf *folderxpm = NULL;
+static GdkPixbuf *folderopenxpm = NULL;
+static GdkPixbuf *groupxpm = NULL;
+static GdkPixbuf *interfacexpm = NULL;
+static GdkPixbuf *bookxpm = NULL;
+static GdkPixbuf *addressxpm = NULL;
+static GdkPixbuf *vcardxpm = NULL;
+static GdkPixbuf *jpilotxpm = NULL;
+static GdkPixbuf *categoryxpm = NULL;
+static GdkPixbuf *ldapxpm = NULL;
+static GdkPixbuf *addrsearchxpm = NULL;
 
 /* Message buffer */
 static gchar addressbook_msgbuf[ ADDRESSBOOK_MSGBUF_SIZE ];
@@ -1231,8 +1231,6 @@ static void addressbook_create(void)
                         G_CALLBACK(addressbook_close_clicked), NULL);
 
        /* Build icons for interface */
-       stock_pixbuf_gdk( window, STOCK_PIXMAP_INTERFACE,
-                         &interfacexpm );
 
        /* Build control tables */
        addrbookctl_build_map(window);
@@ -4766,13 +4764,35 @@ ItemObjectType addressbook_type2item( AddressObjectType abType ) {
        return ioType;
 }
 
+#define UPDATE_ICON_ATCI(id,icon,iconopen) {                   \
+       atci = addrbookctl_lookup(id);                          \
+       if (atci) {                                             \
+               atci->iconXpm = icon;                           \
+               atci->iconXpmOpen = iconopen;                   \
+       } else {                                                \
+               g_warning("can't get atci %d\n", id);           \
+       }                                                       \
+}
+
 /*
 * Build table that controls the rendering of object types.
 */
-static void addrbookctl_build_map( GtkWidget *window ) {
+static void addrbookctl_build_icons( GtkWidget *window ) {
        AddressTypeControlItem *atci;
 
        /* Build icons */
+       g_object_unref(interfacexpm);
+       g_object_unref(folderxpm);
+       g_object_unref(folderopenxpm);
+       g_object_unref(groupxpm);
+       g_object_unref(vcardxpm);
+       g_object_unref(bookxpm);
+       g_object_unref(addressxpm);
+       g_object_unref(jpilotxpm);
+       g_object_unref(categoryxpm);
+       g_object_unref(ldapxpm);
+       g_object_unref(addrsearchxpm);
+       stock_pixbuf_gdk(window, STOCK_PIXMAP_INTERFACE, &interfacexpm );
        stock_pixbuf_gdk(window, STOCK_PIXMAP_DIR_CLOSE, &folderxpm);
        stock_pixbuf_gdk(window, STOCK_PIXMAP_DIR_OPEN, &folderopenxpm);
        stock_pixbuf_gdk(window, STOCK_PIXMAP_GROUP, &groupxpm);
@@ -4783,6 +4803,26 @@ static void addrbookctl_build_map( GtkWidget *window ) {
        stock_pixbuf_gdk(window, STOCK_PIXMAP_CATEGORY, &categoryxpm);
        stock_pixbuf_gdk(window, STOCK_PIXMAP_LDAP, &ldapxpm);
        stock_pixbuf_gdk(window, STOCK_PIXMAP_ADDRESS_SEARCH, &addrsearchxpm);
+       
+       UPDATE_ICON_ATCI(ADDR_INTERFACE,folderxpm,folderopenxpm);
+       UPDATE_ICON_ATCI(ADDR_BOOK,bookxpm,bookxpm);
+       UPDATE_ICON_ATCI(ADDR_ITEM_PERSON,NULL,NULL);
+       UPDATE_ICON_ATCI(ADDR_ITEM_EMAIL,addressxpm,addressxpm);
+       UPDATE_ICON_ATCI(ADDR_ITEM_GROUP,groupxpm,groupxpm);
+       UPDATE_ICON_ATCI(ADDR_ITEM_FOLDER,folderxpm,folderopenxpm);
+       UPDATE_ICON_ATCI(ADDR_VCARD,vcardxpm,vcardxpm);
+       UPDATE_ICON_ATCI(ADDR_JPILOT,jpilotxpm,jpilotxpm);
+       UPDATE_ICON_ATCI(ADDR_CATEGORY,categoryxpm,categoryxpm);
+       UPDATE_ICON_ATCI(ADDR_LDAP,ldapxpm,ldapxpm);
+       UPDATE_ICON_ATCI(ADDR_LDAP_QUERY,addrsearchxpm,addrsearchxpm);
+
+}
+
+/*
+* Build table that controls the rendering of object types.
+*/
+static void addrbookctl_build_map( GtkWidget *window ) {
+       AddressTypeControlItem *atci;
 
        _addressBookTypeHash_ = g_hash_table_new( g_int_hash, g_int_equal );
        _addressBookTypeList_ = NULL;
@@ -4795,8 +4835,6 @@ static void addrbookctl_build_map( GtkWidget *window ) {
        atci->treeExpand = TRUE;
        atci->treeLeaf = FALSE;
        atci->displayName = _( "Interface" );
-       atci->iconXpm = folderxpm;
-       atci->iconXpmOpen = folderopenxpm;
        atci->menuCommand = NULL;
        g_hash_table_insert( _addressBookTypeHash_, &atci->objectType, atci );
        _addressBookTypeList_ = g_list_append( _addressBookTypeList_, atci );
@@ -4809,8 +4847,6 @@ static void addrbookctl_build_map( GtkWidget *window ) {
        atci->treeExpand = TRUE;
        atci->treeLeaf = FALSE;
        atci->displayName = _( "Address Book" );
-       atci->iconXpm = bookxpm;
-       atci->iconXpmOpen = bookxpm;
        atci->menuCommand = "Menu/Book/NewBook";
        g_hash_table_insert( _addressBookTypeHash_, &atci->objectType, atci );
        _addressBookTypeList_ = g_list_append( _addressBookTypeList_, atci );
@@ -4823,8 +4859,6 @@ static void addrbookctl_build_map( GtkWidget *window ) {
        atci->treeExpand = FALSE;
        atci->treeLeaf = FALSE;
        atci->displayName = _( "Person" );
-       atci->iconXpm = NULL;
-       atci->iconXpmOpen = NULL;
        atci->menuCommand = NULL;
        g_hash_table_insert( _addressBookTypeHash_, &atci->objectType, atci );
        _addressBookTypeList_ = g_list_append( _addressBookTypeList_, atci );
@@ -4837,8 +4871,6 @@ static void addrbookctl_build_map( GtkWidget *window ) {
        atci->treeExpand = FALSE;
        atci->treeLeaf = TRUE;
        atci->displayName = _( "Email Address" );
-       atci->iconXpm = addressxpm;
-       atci->iconXpmOpen = addressxpm;
        atci->menuCommand = NULL;
        g_hash_table_insert( _addressBookTypeHash_, &atci->objectType, atci );
        _addressBookTypeList_ = g_list_append( _addressBookTypeList_, atci );
@@ -4851,8 +4883,6 @@ static void addrbookctl_build_map( GtkWidget *window ) {
        atci->treeExpand = FALSE;
        atci->treeLeaf = FALSE;
        atci->displayName = _( "Group" );
-       atci->iconXpm = groupxpm;
-       atci->iconXpmOpen = groupxpm;
        atci->menuCommand = NULL;
        g_hash_table_insert( _addressBookTypeHash_, &atci->objectType, atci );
        _addressBookTypeList_ = g_list_append( _addressBookTypeList_, atci );
@@ -4865,8 +4895,6 @@ static void addrbookctl_build_map( GtkWidget *window ) {
        atci->treeExpand = FALSE;
        atci->treeLeaf = FALSE;
        atci->displayName = _( "Folder" );
-       atci->iconXpm = folderxpm;
-       atci->iconXpmOpen = folderopenxpm;
        atci->menuCommand = NULL;
        g_hash_table_insert( _addressBookTypeHash_, &atci->objectType, atci );
        _addressBookTypeList_ = g_list_append( _addressBookTypeList_, atci );
@@ -4879,8 +4907,6 @@ static void addrbookctl_build_map( GtkWidget *window ) {
        atci->treeExpand = TRUE;
        atci->treeLeaf = TRUE;
        atci->displayName = _( "vCard" );
-       atci->iconXpm = vcardxpm;
-       atci->iconXpmOpen = vcardxpm;
        atci->menuCommand = "Menu/Book/NewVCard";
        g_hash_table_insert( _addressBookTypeHash_, &atci->objectType, atci );
        _addressBookTypeList_ = g_list_append( _addressBookTypeList_, atci );
@@ -4893,8 +4919,6 @@ static void addrbookctl_build_map( GtkWidget *window ) {
        atci->treeExpand = TRUE;
        atci->treeLeaf = FALSE;
        atci->displayName = _( "JPilot" );
-       atci->iconXpm = jpilotxpm;
-       atci->iconXpmOpen = jpilotxpm;
        atci->menuCommand = "Menu/Book/NewJPilot";
        g_hash_table_insert( _addressBookTypeHash_, &atci->objectType, atci );
        _addressBookTypeList_ = g_list_append( _addressBookTypeList_, atci );
@@ -4907,8 +4931,6 @@ static void addrbookctl_build_map( GtkWidget *window ) {
        atci->treeExpand = TRUE;
        atci->treeLeaf = TRUE;
        atci->displayName = _( "JPilot" );
-       atci->iconXpm = categoryxpm;
-       atci->iconXpmOpen = categoryxpm;
        atci->menuCommand = NULL;
        g_hash_table_insert( _addressBookTypeHash_, &atci->objectType, atci );
        _addressBookTypeList_ = g_list_append( _addressBookTypeList_, atci );
@@ -4921,8 +4943,6 @@ static void addrbookctl_build_map( GtkWidget *window ) {
        atci->treeExpand = TRUE;
        atci->treeLeaf = FALSE;
        atci->displayName = _( "LDAP servers" );
-       atci->iconXpm = ldapxpm;
-       atci->iconXpmOpen = ldapxpm;
        atci->menuCommand = "Menu/Book/NewLDAPServer";
        g_hash_table_insert( _addressBookTypeHash_, &atci->objectType, atci );
        _addressBookTypeList_ = g_list_append( _addressBookTypeList_, atci );
@@ -4935,12 +4955,17 @@ static void addrbookctl_build_map( GtkWidget *window ) {
        atci->treeExpand = FALSE;
        atci->treeLeaf = TRUE;
        atci->displayName = _( "LDAP Query" );
-       atci->iconXpm = addrsearchxpm;
-       atci->iconXpmOpen = addrsearchxpm;
        atci->menuCommand = NULL;
        g_hash_table_insert( _addressBookTypeHash_, &atci->objectType, atci );
        _addressBookTypeList_ = g_list_append( _addressBookTypeList_, atci );
 
+       addrbookctl_build_icons(window);
+}
+
+void addressbook_reflect_prefs_pixmap_theme(void)
+{
+       if (addrbook.window)
+               addrbookctl_build_icons(addrbook.window);
 }
 
 /*
index d70bfc3ca44b1f1f36e1276d10bf51d01642a400..880d28f1dee85afb9df294c225ebce229ee747ca 100644 (file)
@@ -355,7 +355,7 @@ md5_hex_digest_file(char *hexdigest, const unsigned char *file)
        char *lastp = buf; /* point to the start of the buffer */
        size_t total = 0; /* total length read */
        int num_alloc = 1; /* number of blocks allocated */
-       int fd = open(file, O_RDONLY);
+       int fd = g_open(file, O_RDONLY);
 
        if (fd == -1) {
                FILE_OP_ERROR(file, "open");
index a2b16c47bf0e5c74d31f7e8ca237f1c331669968..38eb8726ec85174be4fd09a7eb89a559cf91a3fa 100644 (file)
@@ -537,7 +537,7 @@ static guint check_cert(gnutls_x509_crt cert)
        FILE *fp;
 
        if (claws_ssl_get_cert_file())
-               fp = fopen(claws_ssl_get_cert_file(), "r");
+               fp = g_fopen(claws_ssl_get_cert_file(), "r");
        else
                return (guint)-1;
 
index 30ef8842cf8e961c922ba0cc639a13f4d9db5325..c55e3d7140e4b9be219fa90fc00c10c38d42243f 100644 (file)
@@ -50,7 +50,7 @@ void tags_read_tags(void)
                        TAGS_RC, NULL);
        gchar tmp[255];
        gint id;
-       FILE *fp = fopen(file, "rb");
+       FILE *fp = g_fopen(file, "rb");
        
        g_free(file);
 
@@ -122,10 +122,10 @@ void tags_write_tags(void)
                        TAGS_RC, NULL);
        TagWriteData data;
 
-       FILE *fp = fopen(file, "wb");
+       FILE *fp = g_fopen(file, "wb");
                        
        if (!fp) {
-               FILE_OP_ERROR(file, "fopen");
+               FILE_OP_ERROR(file, "g_fopen");
                g_free(file);
                g_free(file_new);
                return;
index 6690f6c1c8bded49ef9ff4f9235c1c449a960b6f..55634b7a9a0d58239e7ee1ae0847e97b10f779e9 100644 (file)
@@ -196,6 +196,17 @@ FILE* g_fopen(const gchar *filename, const gchar *mode)
        return fopen(filename, mode);
 #endif
 }
+int g_open(const gchar *filename, int flags, int mode)
+{
+#ifdef G_OS_WIN32
+       char *name = g_win32_locale_filename_from_utf8(filename);
+       int fd = open(name, flags, mode);
+       g_free(name);
+       return fp;
+#else
+       return open(filename, flags, mode);
+#endif
+}
 #endif /* GLIB_CHECK_VERSION && G_OS_UNIX */
 
 
@@ -207,7 +218,7 @@ gint mkstemp_name(gchar *template, gchar **name_used)
        int tmpfd;
 
        *name_used = g_strdup_printf("%s.%ld",_mktemp(template),count++);
-       tmpfd = open (*name_used, (O_CREAT | O_RDWR | O_BINARY),
+       tmpfd = g_open (*name_used, (O_CREAT | O_RDWR | O_BINARY),
                                    (S_IRUSR | S_IWUSR));
 
        tempfiles=g_slist_append(tempfiles, g_strdup(*name_used));
@@ -469,11 +480,11 @@ gint file_strip_crs(const gchar *file)
        if (file == NULL)
                goto freeout;
 
-       fp = fopen(file, "rb");
+       fp = g_fopen(file, "rb");
        if (!fp)
                goto freeout;
 
-       outfp = fopen(out, "wb");
+       outfp = g_fopen(out, "wb");
        if (!outfp) {
                fclose(fp);
                goto freeout;
@@ -2098,7 +2109,7 @@ off_t get_file_size_as_crlf(const gchar *file)
        gchar buf[BUFFSIZE];
 
        if ((fp = g_fopen(file, "rb")) == NULL) {
-               FILE_OP_ERROR(file, "fopen");
+               FILE_OP_ERROR(file, "g_fopen");
                return -1;
        }
 
@@ -2489,12 +2500,12 @@ gint append_file(const gchar *src, const gchar *dest, gboolean keep_backup)
        gboolean err = FALSE;
 
        if ((src_fp = g_fopen(src, "rb")) == NULL) {
-               FILE_OP_ERROR(src, "fopen");
+               FILE_OP_ERROR(src, "g_fopen");
                return -1;
        }
 
        if ((dest_fp = g_fopen(dest, "ab")) == NULL) {
-               FILE_OP_ERROR(dest, "fopen");
+               FILE_OP_ERROR(dest, "g_fopen");
                fclose(src_fp);
                return -1;
        }
@@ -2543,7 +2554,7 @@ gint copy_file(const gchar *src, const gchar *dest, gboolean keep_backup)
        gboolean err = FALSE;
 
        if ((src_fp = g_fopen(src, "rb")) == NULL) {
-               FILE_OP_ERROR(src, "fopen");
+               FILE_OP_ERROR(src, "g_fopen");
                return -1;
        }
        if (is_file_exist(dest)) {
@@ -2557,7 +2568,7 @@ gint copy_file(const gchar *src, const gchar *dest, gboolean keep_backup)
        }
 
        if ((dest_fp = g_fopen(dest, "wb")) == NULL) {
-               FILE_OP_ERROR(dest, "fopen");
+               FILE_OP_ERROR(dest, "g_fopen");
                fclose(src_fp);
                if (dest_bak) {
                        if (rename_force(dest_bak, dest) < 0)
@@ -2678,7 +2689,7 @@ gint copy_file_part(FILE *fp, off_t offset, size_t length, const gchar *dest)
        gboolean err = FALSE;
 
        if ((dest_fp = g_fopen(dest, "wb")) == NULL) {
-               FILE_OP_ERROR(dest, "fopen");
+               FILE_OP_ERROR(dest, "g_fopen");
                return -1;
        }
 
@@ -2749,12 +2760,12 @@ gint canonicalize_file(const gchar *src, const gchar *dest)
        gboolean last_linebreak = FALSE;
 
        if ((src_fp = g_fopen(src, "rb")) == NULL) {
-               FILE_OP_ERROR(src, "fopen");
+               FILE_OP_ERROR(src, "g_fopen");
                return -1;
        }
 
        if ((dest_fp = g_fopen(dest, "wb")) == NULL) {
-               FILE_OP_ERROR(dest, "fopen");
+               FILE_OP_ERROR(dest, "g_fopen");
                fclose(src_fp);
                return -1;
        }
@@ -3056,7 +3067,7 @@ gint str_write_to_file(const gchar *str, const gchar *file)
        g_return_val_if_fail(file != NULL, -1);
 
        if ((fp = g_fopen(file, "wb")) == NULL) {
-               FILE_OP_ERROR(file, "fopen");
+               FILE_OP_ERROR(file, "g_fopen");
                return -1;
        }
 
@@ -3147,14 +3158,14 @@ static gchar *file_read_to_str_full(const gchar *file, gboolean recode)
        }
 
 #ifdef G_OS_WIN32
-       fp = fopen (file, "rb");
+       fp = g_fopen (file, "rb");
        if (fp == NULL) {
                FILE_OP_ERROR(file, "open");
                return NULL;
        }
 #else    
        /* test whether the file is readable without blocking */
-       fd = open(file, O_RDONLY | O_NONBLOCK);
+       fd = g_open(file, O_RDONLY | O_NONBLOCK);
        if (fd == -1) {
                FILE_OP_ERROR(file, "open");
                return NULL;
@@ -4572,7 +4583,7 @@ gchar *make_http_string(const gchar *bp, const gchar *ep)
 
 static gchar *mailcap_get_command_in_file(const gchar *path, const gchar *type, const gchar *file_to_open)
 {
-       FILE *fp = fopen(path, "rb");
+       FILE *fp = g_fopen(path, "rb");
        gchar buf[BUFFSIZE];
        gchar *result = NULL;
        if (!fp)
@@ -4685,8 +4696,8 @@ void mailcap_update_default(const gchar *type, const gchar *command)
        gchar *path = NULL, *outpath = NULL;
        path = g_strconcat(get_home_dir(), G_DIR_SEPARATOR_S, ".mailcap", NULL);
        outpath = g_strconcat(get_home_dir(), G_DIR_SEPARATOR_S, ".mailcap.new", NULL);
-       FILE *fp = fopen(path, "rb");
-       FILE *outfp = fopen(outpath, "wb");
+       FILE *fp = g_fopen(path, "rb");
+       FILE *outfp = g_fopen(outpath, "wb");
        gchar buf[BUFFSIZE];
        gboolean err = FALSE;
 
index ead42ff319dfc349beb26f61b3a473f3325104b5..992a67b7142f00bf2ff33226e932bdf8f20524cc 100644 (file)
@@ -10156,7 +10156,7 @@ static void compose_insert_drag_received_cb (GtkWidget          *widget,
        /* strangely, testing data->type == gdk_atom_intern("text/uri-list", TRUE)
         * does not work */
        debug_print("drop: %s (%s)\n", gdk_atom_name(data->type)?gdk_atom_name(data->type):"nul",
-               data->data?data->data:"nul");
+               (gchar *)(data->data?data->data:"nul"));
 #ifndef G_OS_WIN32
        if (gdk_atom_name(data->type) && !strcmp(gdk_atom_name(data->type), "text/uri-list")) {
 #else
@@ -10166,7 +10166,7 @@ static void compose_insert_drag_received_cb (GtkWidget          *widget,
 
                list = uri_list_extract_filenames((const gchar *)data->data);
                debug_print("list: %p (%s)\n", list, 
-                       data->data?data->data:"nul");
+                       (gchar *)(data->data?data->data:"nul"));
                if (list == NULL && strstr((gchar *)(data->data), "://")) {
                        /* Assume a list of no files, and data has ://, is a remote link */
                        gchar *tmpdata = g_strstrip(g_strdup((const gchar *)data->data));
index 4d33fae4940df944d15ccdf12fafb25bb58e824b..4521e00184fd1f47d5e3a198599e4da9608b372a 100644 (file)
@@ -2459,7 +2459,7 @@ static void fetch_content_run(struct etpan_thread_op * op)
        result->error = r;
        
        if (r == MAILIMAP_NO_ERROR) {
-               fd = open(param->filename, O_RDWR | O_CREAT, 0600);
+               fd = g_open(param->filename, O_RDWR | O_CREAT, 0600);
                if (fd < 0) {
                        result->error = MAILIMAP_ERROR_FETCH;
                        goto free;
@@ -2960,7 +2960,7 @@ static void append_run(struct etpan_thread_op * op)
        }
        size = stat_buf.st_size;
        
-       fd = open(param->filename, O_RDONLY);
+       fd = g_open(param->filename, O_RDONLY);
        if (fd < 0) {
                result->error = MAILIMAP_ERROR_APPEND;
                return;
@@ -3246,7 +3246,7 @@ static void do_exec_command(int fd, const char * command,
        /* Detach from the controlling tty if we have one. Otherwise,
           SSH might do something stupid like trying to use it instead
           of running $SSH_ASKPASS. Doh. */
-       fd = open("/dev/tty", O_RDONLY);
+       fd = g_open("/dev/tty", O_RDONLY);
        if (fd != -1) {
                ioctl(fd, TIOCNOTTY, NULL);
                close(fd);
index 4e17c959726c67c7b3f4374deb35f5b2244d018e..a921b3deaa273586707a83398397c8ffe80527ca 100644 (file)
@@ -345,7 +345,8 @@ static void foldersel_init(void)
                         &foldernoselect_pixbuf);
 }
 
-void foldersel_reflect_prefs_pixmap_theme(void){
+void foldersel_reflect_prefs_pixmap_theme(void)
+{
        if (folder_pixbuf)
                g_object_unref(folder_pixbuf);
        if (folderopen_pixbuf)
index af10176612683659a9fde468427bd1165ced5324..2a549474db8401b6651767adbf8aa712e5b04e9e 100644 (file)
@@ -2493,7 +2493,7 @@ static void install_memory_sighandler()
        struct sigaction act;
        int flags;
 
-       mem_notify_fd = open("/dev/mem_notify", O_RDONLY|O_NONBLOCK);
+       mem_notify_fd = g_open("/dev/mem_notify", O_RDONLY|O_NONBLOCK);
        if (mem_notify_fd == -1) {
                debug_print("/dev/mem_notify not available (%s)\n", 
                        strerror(errno));
index 86d332140f2bf12ec51b9ab50fc54397fae59b88..6ded072a2aed10e52f0a972a528b0fda8609a288 100644 (file)
@@ -2394,6 +2394,7 @@ static gboolean reflect_prefs_timeout_cb(gpointer data)
                        folderview_reflect_prefs_pixmap_theme(mainwin->folderview);
                        summary_reflect_prefs_pixmap_theme(mainwin->summaryview);
                        foldersel_reflect_prefs_pixmap_theme();
+                       addressbook_reflect_prefs_pixmap_theme();
 #ifndef GENERIC_UMPC
                        pixmap = stock_pixmap_widget(mainwin->hbox_stat, STOCK_PIXMAP_ONLINE);
                        gtk_container_remove(GTK_CONTAINER(mainwin->online_switch), 
index f7fcae43d86365d296a9bfa839927854fe767f62..f80c039c545d5b87f8527f61127791dbd0c3c725 100644 (file)
@@ -358,9 +358,9 @@ gint lock_mbox(const gchar *base, LockType type)
 #endif
 
 #if HAVE_FLOCK
-               if ((lockfd = open(base, O_RDWR)) < 0) {
+               if ((lockfd = g_open(base, O_RDWR)) < 0) {
 #else
-               if ((lockfd = open(base, O_RDWR)) < 0) {
+               if ((lockfd = g_open(base, O_RDWR)) < 0) {
 #endif
                        FILE_OP_ERROR(base, "open");
                        return -1;
index d074b3a90991fc523ccb5165674e16814acf0dc4..5a293af88ba779bd185133c67c32d80b330076c7 100644 (file)
@@ -272,8 +272,8 @@ static void bogofilter_do_filter(BogoFilterData *data)
                                            FOLDER_TYPE(msginfo->folder->folder) == F_MH &&
                                            config.insert_header) {
                                                gchar *tmpfile = get_tmp_file();
-                                               FILE *input = fopen(file, "r");
-                                               FILE *output = fopen(tmpfile, "w");
+                                               FILE *input = g_fopen(file, "r");
+                                               FILE *output = g_fopen(tmpfile, "w");
                                                if (strstr(parts[2], "\n"))
                                                        *(strstr(parts[2], "\n")) = '\0';
                                                if (input && !output) 
index cd5f5f656f1003d50ed4d5d01f9d14879c22db97..9c626ff852b9e7f602b2d7fd90b403e3eef7a99a 100644 (file)
@@ -133,7 +133,7 @@ static gchar *get_part_as_string(MimeInfo *mimeinfo)
                        printf("error dumping file\n");
                        return NULL;
                }
-               fp = fopen(filename,"rb");
+               fp = g_fopen(filename,"rb");
                if (!fp) {
                        printf("error reading file\n");
                        return NULL;
index d305b2cae3c9e9ef7e45814e4543acd0618720bc..e4199bddd006437a0363c1ae92e89464234abb3f 100644 (file)
@@ -430,7 +430,7 @@ static MimeInfo *smime_decrypt(MimeInfo *mimeinfo)
                get_mime_tmp_dir(), G_DIR_SEPARATOR, ++id);
 
        if ((dstfp = g_fopen(fname, "wb")) == NULL) {
-               FILE_OP_ERROR(fname, "fopen");
+               FILE_OP_ERROR(fname, "g_fopen");
                g_free(fname);
                gpgme_data_release(plain);
                gpgme_release(ctx);
@@ -795,7 +795,7 @@ gboolean smime_encrypt(MimeInfo *mimeinfo, const gchar *encrypt_data)
 
        /* write message content to temporary file */
        tmpfile = get_tmp_file();
-       fp = fopen(tmpfile, "wb");
+       fp = g_fopen(tmpfile, "wb");
        if (fp == NULL) {
                perror("get_tmp_file");
                return FALSE;
@@ -805,7 +805,7 @@ gboolean smime_encrypt(MimeInfo *mimeinfo, const gchar *encrypt_data)
        procmime_write_mimeinfo(msgcontent, fp);
        fclose(fp);
        canonicalize_file_replace(tmpfile);
-       fp = fopen(tmpfile, "rb");
+       fp = g_fopen(tmpfile, "rb");
        if (fp == NULL) {
                perror("get_tmp_file");
                return FALSE;
@@ -834,7 +834,7 @@ gboolean smime_encrypt(MimeInfo *mimeinfo, const gchar *encrypt_data)
        }
 
        tmpfile = get_tmp_file();
-       fp = fopen(tmpfile, "wb");
+       fp = g_fopen(tmpfile, "wb");
        if (fp) {
                if (fwrite(enccontent, 1, len, fp) < len) {
                        FILE_OP_ERROR(tmpfile, "fwrite");