talons

Fork of Claws Mail https://www.claws-mail
Log | Files | Refs | README | LICENSE

commit 180dd13e4f3c5997954c4a27eee2fea51f1842b3
parent c0bf5693a4ccb0f7d812bb8cf293ba278b581ba8
Author: Colin Leroy <colin@colino.net>
Date:   Sat, 17 Jan 2009 16:24:32 +0000

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

Diffstat:
MChangeLog | 21+++++++++++++++++++++
MPATCHSETS | 1+
Mconfigure.ac | 2+-
Msrc/addressbook.c | 97++++++++++++++++++++++++++++++++++++++++++++++++++-----------------------------
Msrc/common/md5.c | 2+-
Msrc/common/ssl_certificate.c | 2+-
Msrc/common/tags.c | 6+++---
Msrc/common/utils.c | 45++++++++++++++++++++++++++++-----------------
Msrc/compose.c | 4++--
Msrc/etpan/imap-thread.c | 6+++---
Msrc/foldersel.c | 3++-
Msrc/main.c | 2+-
Msrc/mainwindow.c | 1+
Msrc/mbox.c | 4++--
Msrc/plugins/bogofilter/bogofilter.c | 4++--
Msrc/plugins/pgpinline/pgpinline.c | 2+-
Msrc/plugins/smime/smime.c | 8++++----
17 files changed, 135 insertions(+), 75 deletions(-)

diff --git 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 diff --git a/PATCHSETS b/PATCHSETS @@ -3698,3 +3698,4 @@ ( 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 diff --git a/configure.ac b/configure.ac @@ -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= diff --git a/src/addressbook.c b/src/addressbook.c @@ -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); } /* diff --git a/src/common/md5.c b/src/common/md5.c @@ -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"); diff --git a/src/common/ssl_certificate.c b/src/common/ssl_certificate.c @@ -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; diff --git a/src/common/tags.c b/src/common/tags.c @@ -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; diff --git a/src/common/utils.c b/src/common/utils.c @@ -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; diff --git a/src/compose.c b/src/compose.c @@ -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)); diff --git a/src/etpan/imap-thread.c b/src/etpan/imap-thread.c @@ -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); diff --git a/src/foldersel.c b/src/foldersel.c @@ -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) diff --git a/src/main.c b/src/main.c @@ -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)); diff --git a/src/mainwindow.c b/src/mainwindow.c @@ -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), diff --git a/src/mbox.c b/src/mbox.c @@ -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; diff --git a/src/plugins/bogofilter/bogofilter.c b/src/plugins/bogofilter/bogofilter.c @@ -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) diff --git a/src/plugins/pgpinline/pgpinline.c b/src/plugins/pgpinline/pgpinline.c @@ -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; diff --git a/src/plugins/smime/smime.c b/src/plugins/smime/smime.c @@ -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");