[evolution-data-server/camel-gobject] Minor changes to sync with master.
- From: Matthew Barnes <mbarnes src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution-data-server/camel-gobject] Minor changes to sync with master.
- Date: Wed, 21 Apr 2010 13:02:05 +0000 (UTC)
commit 9e1b8fd27714e881dc015bfaa2a8213acc12fa95
Author: Matthew Barnes <mbarnes redhat com>
Date: Tue Apr 20 09:44:49 2010 -0400
Minor changes to sync with master.
camel/camel-folder.c | 9 +-
camel/camel-folder.h | 1 -
camel/camel-net-utils.h | 11 +-
camel/camel-offline-folder.c | 14 +-
camel/camel-offline-folder.h | 4 +-
camel/camel-offline-store.c | 14 +-
camel/camel-offline-store.h | 6 +-
camel/camel-operation.h | 2 +-
camel/camel-provider.c | 12 +-
camel/camel-service.c | 4 +-
camel/camel-store.c | 10 +-
camel/camel-store.h | 2 +-
camel/camel-tcp-stream-raw.h | 2 +-
camel/camel-tcp-stream.h | 2 +-
camel/camel-vee-folder.c | 338 ++++++++++----------
camel/camel-vtrash-folder.c | 3 +-
camel/providers/groupwise/camel-groupwise-folder.c | 35 ++-
camel/providers/groupwise/camel-groupwise-store.c | 24 +-
.../groupwise/camel-groupwise-transport.c | 6 -
camel/providers/groupwise/camel-groupwise-utils.c | 32 +-
camel/providers/imap/camel-imap-folder.c | 2 +-
camel/providers/imap/camel-imap-search.c | 2 +-
camel/providers/imap/camel-imap-store-summary.c | 1 -
camel/providers/imap/camel-imap-store.c | 24 +-
camel/providers/imap/camel-imap-wrapper.c | 8 +-
camel/providers/local/camel-local-folder.c | 2 -
camel/providers/local/camel-local-private.h | 1 -
camel/providers/local/camel-local-store.c | 2 +-
camel/providers/local/camel-maildir-folder.c | 1 +
camel/providers/local/camel-maildir-store.c | 4 +-
camel/providers/local/camel-mbox-store.c | 2 +-
camel/providers/local/camel-mbox-summary.c | 1 -
camel/providers/local/camel-mh-folder.c | 1 +
camel/providers/local/camel-mh-summary.c | 1 -
camel/providers/local/camel-spool-summary.c | 2 +-
camel/providers/nntp/camel-nntp-folder.c | 3 +-
camel/providers/nntp/camel-nntp-newsrc.c | 1 -
camel/providers/nntp/camel-nntp-store-summary.h | 1 -
camel/providers/nntp/camel-nntp-store.c | 13 +-
camel/providers/nntp/camel-nntp-stream.c | 4 +-
camel/providers/nntp/camel-nntp-summary.c | 2 +-
camel/providers/nntp/camel-nntp-summary.h | 1 -
camel/providers/pop3/camel-pop3-folder.c | 5 +-
camel/providers/pop3/camel-pop3-store.c | 17 +-
camel/providers/smtp/camel-smtp-provider.c | 5 +
camel/providers/smtp/camel-smtp-transport.c | 7 +-
camel/providers/smtp/camel-smtp-transport.h | 8 +
47 files changed, 347 insertions(+), 305 deletions(-)
---
diff --git a/camel/camel-folder.c b/camel/camel-folder.c
index 5faa9e6..24ac562 100644
--- a/camel/camel-folder.c
+++ b/camel/camel-folder.c
@@ -930,9 +930,7 @@ camel_folder_refresh_info (CamelFolder *folder,
g_return_val_if_fail (class->refresh_info != NULL, FALSE);
CAMEL_FOLDER_REC_LOCK (folder, lock);
-
success = class->refresh_info (folder, error);
-
CAMEL_FOLDER_REC_UNLOCK (folder, lock);
return success;
@@ -1116,15 +1114,15 @@ camel_folder_append_message (CamelFolder *folder,
gboolean success;
g_return_val_if_fail (CAMEL_IS_FOLDER (folder), FALSE);
+ g_return_val_if_fail (CAMEL_IS_MIME_MESSAGE (message), FALSE);
+ g_return_val_if_fail (info != NULL, FALSE);
class = CAMEL_FOLDER_GET_CLASS (folder);
g_return_val_if_fail (class->append_message != NULL, FALSE);
CAMEL_FOLDER_REC_LOCK (folder, lock);
-
success = class->append_message (
folder, message, info, appended_uid, error);
-
CAMEL_FOLDER_REC_UNLOCK (folder, lock);
return success;
@@ -1493,8 +1491,10 @@ camel_folder_sync_message (CamelFolder *folder,
gboolean success = FALSE;
g_return_val_if_fail (CAMEL_IS_FOLDER (folder), FALSE);
+ g_return_val_if_fail (uid != NULL, FALSE);
class = CAMEL_FOLDER_GET_CLASS (folder);
+ g_return_val_if_fail (class->get_message != NULL, FALSE);
CAMEL_FOLDER_REC_LOCK (folder, lock);
@@ -1503,6 +1503,7 @@ camel_folder_sync_message (CamelFolder *folder,
success = class->sync_message (folder, uid, error);
else {
CamelMimeMessage *message;
+
message = class->get_message (folder, uid, error);
if (message != NULL) {
g_object_unref (message);
diff --git a/camel/camel-folder.h b/camel/camel-folder.h
index e5f432f..d25aa11 100644
--- a/camel/camel-folder.h
+++ b/camel/camel-folder.h
@@ -269,7 +269,6 @@ void camel_folder_construct (CamelFolder *folder,
struct _CamelStore *parent_store,
const gchar *full_name,
const gchar *name);
-
gboolean camel_folder_refresh_info (CamelFolder *folder,
GError **error);
gboolean camel_folder_sync (CamelFolder *folder,
diff --git a/camel/camel-net-utils.h b/camel/camel-net-utils.h
index f7d78c7..17ef3a3 100644
--- a/camel/camel-net-utils.h
+++ b/camel/camel-net-utils.h
@@ -33,10 +33,9 @@
#include <sys/socket.h>
#include <netdb.h>
#else
-#define WIN32_LEAN_AND_MEAN
-#include <winsock2.h>
-#undef WIN32_LEAN_AND_MEAN
-#include <ws2tcpip.h>
+#define socklen_t int
+struct sockaddr;
+struct addrinfo;
#endif
G_BEGIN_DECLS
@@ -97,4 +96,8 @@ gint camel_getnameinfo(const struct sockaddr *sa, socklen_t salen, gchar **host,
G_END_DECLS
+#ifdef _WIN32
+#undef socklen_t
+#endif
+
#endif /* CAMEL_NET_UTILS_H */
diff --git a/camel/camel-offline-folder.c b/camel/camel-offline-folder.c
index 5b62b1e..615f821 100644
--- a/camel/camel-offline-folder.c
+++ b/camel/camel-offline-folder.c
@@ -179,7 +179,7 @@ offline_folder_setv (CamelObject *object,
return ((CamelObjectClass *) camel_offline_folder_parent_class)->setv (object, error, args);
}
-static void
+static gboolean
offline_folder_downsync (CamelOfflineFolder *offline,
const gchar *expression,
GError **error)
@@ -219,6 +219,8 @@ done:
camel_folder_free_uids(folder, uncached_uids);
camel_operation_end (NULL);
+
+ return TRUE;
}
static void
@@ -257,18 +259,20 @@ camel_offline_folder_init (CamelOfflineFolder *folder)
*
* Syncs messages in @offline described by the search @expression to
* the local machine for offline availability.
+ *
+ * Returns: %TRUE on success, %FALSE on failure
**/
-void
+gboolean
camel_offline_folder_downsync (CamelOfflineFolder *offline,
const gchar *expression,
GError **error)
{
CamelOfflineFolderClass *class;
- g_return_if_fail (CAMEL_IS_OFFLINE_FOLDER (offline));
+ g_return_val_if_fail (CAMEL_IS_OFFLINE_FOLDER (offline), FALSE);
class = CAMEL_OFFLINE_FOLDER_GET_CLASS (offline);
- g_return_if_fail (class->downsync != NULL);
+ g_return_val_if_fail (class->downsync != NULL, FALSE);
- class->downsync (offline, expression, error);
+ return class->downsync (offline, expression, error);
}
diff --git a/camel/camel-offline-folder.h b/camel/camel-offline-folder.h
index be8bc64..d1efdba 100644
--- a/camel/camel-offline-folder.h
+++ b/camel/camel-offline-folder.h
@@ -71,12 +71,12 @@ struct _CamelOfflineFolder {
struct _CamelOfflineFolderClass {
CamelFolderClass parent_class;
- void (* downsync) (CamelOfflineFolder *folder, const gchar *expression, GError **error);
+ gboolean (* downsync) (CamelOfflineFolder *folder, const gchar *expression, GError **error);
};
GType camel_offline_folder_get_type (void);
-void camel_offline_folder_downsync (CamelOfflineFolder *offline, const gchar *expression, GError **error);
+gboolean camel_offline_folder_downsync (CamelOfflineFolder *offline, const gchar *expression, GError **error);
G_END_DECLS
diff --git a/camel/camel-offline-store.c b/camel/camel-offline-store.c
index 554e1d1..27f8663 100644
--- a/camel/camel-offline-store.c
+++ b/camel/camel-offline-store.c
@@ -96,7 +96,7 @@ camel_offline_store_get_network_state (CamelOfflineStore *store,
* Set the network state to either #CAMEL_OFFLINE_STORE_NETWORK_AVAIL
* or #CAMEL_OFFLINE_STORE_NETWORK_UNAVAIL.
**/
-void
+gboolean
camel_offline_store_set_network_state (CamelOfflineStore *store,
gint state,
GError **error)
@@ -105,7 +105,7 @@ camel_offline_store_set_network_state (CamelOfflineStore *store,
gboolean network_state = camel_session_get_network_state (service->session);
if (store->state == state)
- return;
+ return TRUE;
if (store->state == CAMEL_OFFLINE_STORE_NETWORK_AVAIL) {
/* network available -> network unavailable */
@@ -136,17 +136,19 @@ camel_offline_store_set_network_state (CamelOfflineStore *store,
}
if (!camel_service_disconnect (CAMEL_SERVICE (store), network_state, error))
- return;
+ return FALSE;
} else {
store->state = state;
/* network unavailable -> network available */
if (!camel_service_connect (CAMEL_SERVICE (store), error)) {
store->state = CAMEL_OFFLINE_STORE_NETWORK_UNAVAIL;
- return;
+ return FALSE;
}
}
store->state = state;
+
+ return TRUE;
}
/**
@@ -154,7 +156,7 @@ camel_offline_store_set_network_state (CamelOfflineStore *store,
*
* Since: 2.22
**/
-void
+gboolean
camel_offline_store_prepare_for_offline (CamelOfflineStore *store,
GError **error)
{
@@ -186,4 +188,6 @@ camel_offline_store_prepare_for_offline (CamelOfflineStore *store,
camel_store_sync (CAMEL_STORE (store), FALSE, NULL);
}
+
+ return TRUE;
}
diff --git a/camel/camel-offline-store.h b/camel/camel-offline-store.h
index 636ef77..eea8a8f 100644
--- a/camel/camel-offline-store.h
+++ b/camel/camel-offline-store.h
@@ -71,15 +71,15 @@ struct _CamelOfflineStore {
struct _CamelOfflineStoreClass {
CamelStoreClass parent_class;
- void (* set_network_state) (CamelOfflineStore *store, gint state, GError **error);
+ gboolean (* set_network_state) (CamelOfflineStore *store, gint state, GError **error);
};
GType camel_offline_store_get_type (void);
-void camel_offline_store_set_network_state (CamelOfflineStore *store, gint state, GError **error);
+gboolean camel_offline_store_set_network_state (CamelOfflineStore *store, gint state, GError **error);
gint camel_offline_store_get_network_state (CamelOfflineStore *store, GError **error);
-void camel_offline_store_prepare_for_offline (CamelOfflineStore *store, GError **error);
+gboolean camel_offline_store_prepare_for_offline (CamelOfflineStore *store, GError **error);
G_END_DECLS
diff --git a/camel/camel-operation.h b/camel/camel-operation.h
index 1a5ca83..7803fb7 100644
--- a/camel/camel-operation.h
+++ b/camel/camel-operation.h
@@ -30,7 +30,7 @@
G_BEGIN_DECLS
-/* cancellation helper stuff, not yet finalised */
+/* cancellation helper stuff, not yet finalized */
typedef struct _CamelOperation CamelOperation;
diff --git a/camel/camel-provider.c b/camel/camel-provider.c
index 9513867..5fbed59 100644
--- a/camel/camel-provider.c
+++ b/camel/camel-provider.c
@@ -67,10 +67,10 @@ static CamelProvider vee_provider = {
/* ... */
};
-static pthread_once_t setup_once = PTHREAD_ONCE_INIT;
+static GOnce setup_once = G_ONCE_INIT;
-static void
-provider_setup(void)
+static gpointer
+provider_setup (gpointer param)
{
module_table = g_hash_table_new(camel_strcase_hash, camel_strcase_equal);
provider_table = g_hash_table_new(camel_strcase_hash, camel_strcase_equal);
@@ -79,6 +79,8 @@ provider_setup(void)
vee_provider.url_hash = camel_url_hash;
vee_provider.url_equal = camel_url_equal;
camel_provider_register(&vee_provider);
+
+ return NULL;
}
/**
@@ -104,7 +106,7 @@ camel_provider_init (void)
CamelProviderModule *m;
static gint loaded = 0;
- pthread_once(&setup_once, provider_setup);
+ g_once (&setup_once, provider_setup, NULL);
if (loaded)
return;
@@ -178,7 +180,7 @@ camel_provider_load (const gchar *path,
GModule *module;
CamelProvider *(*provider_module_init) (void);
- pthread_once(&setup_once, provider_setup);
+ g_once (&setup_once, provider_setup, NULL);
if (!g_module_supported ()) {
g_set_error (
diff --git a/camel/camel-service.c b/camel/camel-service.c
index 743a757..ffa03f6 100644
--- a/camel/camel-service.c
+++ b/camel/camel-service.c
@@ -29,7 +29,6 @@
#include <ctype.h>
#include <errno.h>
-#include <pthread.h>
#include <stdlib.h>
#include <string.h>
@@ -213,8 +212,7 @@ service_construct (CamelService *service,
service->provider = provider;
service->url = camel_url_copy(url);
- service->session = session;
- g_object_ref (session);
+ service->session = g_object_ref (session);
service->status = CAMEL_SERVICE_DISCONNECTED;
diff --git a/camel/camel-store.c b/camel/camel-store.c
index 512655f..9eb517c 100644
--- a/camel/camel-store.c
+++ b/camel/camel-store.c
@@ -257,7 +257,7 @@ store_sync (CamelStore *store,
g_ptr_array_free (folders, TRUE);
- return FALSE;
+ return success;
}
static gboolean
@@ -680,7 +680,7 @@ camel_store_rename_folder (CamelStore *store,
g_ptr_array_free(folders, TRUE);
g_free(old_name);
- return TRUE;
+ return success;
}
/**
@@ -1032,14 +1032,14 @@ folder_info_cmp (gconstpointer ap,
/**
* camel_folder_info_build:
* @folders: an array of #CamelFolderInfo
- * @name_space: an ignorable prefix on the folder names
+ * @namespace: an ignorable prefix on the folder names
* @separator: the hieararchy separator character
* @short_names: %TRUE if the (short) name of a folder is the part after
* the last @separator in the full name. %FALSE if it is the full name.
*
* This takes an array of folders and attaches them together according
* to the hierarchy described by their full_names and @separator. If
- * @name_space is non-%NULL, then it will be ignored as a full_name
+ * @namespace is non-%NULL, then it will be ignored as a full_name
* prefix, for purposes of comparison. If necessary,
* #camel_folder_info_build will create additional #CamelFolderInfo with
* %NULL urls to fill in gaps in the tree. The value of @short_names
@@ -1343,7 +1343,7 @@ camel_store_noop (CamelStore *store,
* @uri0: a folder uri
* @uri1: another folder uri
*
- * Compares 2 folder uris to check that they are equal.
+ * Compares two folder uris to check that they are equal.
*
* Returns: %TRUE if they are equal or %FALSE otherwise
**/
diff --git a/camel/camel-store.h b/camel/camel-store.h
index bde269e..950b45b 100644
--- a/camel/camel-store.h
+++ b/camel/camel-store.h
@@ -296,7 +296,7 @@ void camel_folder_info_free (CamelFolderInfo *fi);
#ifndef CAMEL_DISABLE_DEPRECATED
CamelFolderInfo *
camel_folder_info_build (GPtrArray *folders,
- const gchar *name_space,
+ const gchar *namespace,
gchar separator,
gboolean short_names);
#endif /* CAMEL_DISABLE_DEPRECATED */
diff --git a/camel/camel-tcp-stream-raw.h b/camel/camel-tcp-stream-raw.h
index 435d5fe..72b3310 100644
--- a/camel/camel-tcp-stream-raw.h
+++ b/camel/camel-tcp-stream-raw.h
@@ -57,7 +57,7 @@ struct _CamelTcpStreamRaw {
CamelTcpStream parent;
gint sockfd;
-#ifdef G_OS_WIN32
+#ifdef _WIN32
gint is_nonblocking;
#endif
};
diff --git a/camel/camel-tcp-stream.h b/camel/camel-tcp-stream.h
index ef12640..b109cd6 100644
--- a/camel/camel-tcp-stream.h
+++ b/camel/camel-tcp-stream.h
@@ -27,7 +27,7 @@
#ifndef CAMEL_TCP_STREAM_H
#define CAMEL_TCP_STREAM_H
-#ifndef G_OS_WIN32
+#ifndef _WIN32
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
diff --git a/camel/camel-vee-folder.c b/camel/camel-vee-folder.c
index dd390e0..fdb227f 100644
--- a/camel/camel-vee-folder.c
+++ b/camel/camel-vee-folder.c
@@ -82,11 +82,14 @@ vee_folder_add_uid (CamelVeeFolder *vf,
/* same as vee_folder_add_uid, only returns whether uid was added or not */
static gboolean
-vee_folder_add_uid_test (CamelVeeFolder *vf, CamelFolder *f, const gchar *inid, const gchar hash[8])
+vee_folder_add_uid_test (CamelVeeFolder *vf,
+ CamelFolder *f,
+ const gchar *inuid,
+ const gchar hash[8])
{
CamelVeeMessageInfo *mi;
- mi = vee_folder_add_uid (vf, f, inid, hash);
+ mi = vee_folder_add_uid (vf, f, inuid, hash);
if (mi != NULL)
camel_message_info_free ((CamelMessageInfo *) mi);
@@ -845,145 +848,6 @@ vee_folder_stop_folder (CamelVeeFolder *vf, CamelFolder *sub)
}
static void
-vee_folder_remove_folder_helper (CamelVeeFolder *vf, CamelFolder *source)
-{
- gint i, count, n, still = FALSE, start, last;
- gchar *oldkey;
- CamelFolder *folder = (CamelFolder *)vf;
- gchar hash[8];
- CamelFolderChangeInfo *vf_changes = NULL, *unmatched_changes = NULL;
- gpointer oldval;
- CamelVeeFolder *folder_unmatched = vf->parent_vee_store ? vf->parent_vee_store->folder_unmatched : NULL;
- GHashTable *unmatched_uids = vf->parent_vee_store ? vf->parent_vee_store->unmatched_uids : NULL;
- CamelFolderSummary *ssummary = source->summary;
- gint killun = FALSE;
-
- if (vf == folder_unmatched)
- return;
-
- if ((source->folder_flags & CAMEL_FOLDER_HAS_BEEN_DELETED))
- killun = TRUE;
-
- CAMEL_VEE_FOLDER_LOCK (vf, summary_lock);
-
- if (folder_unmatched != NULL) {
- /* check if this folder is still to be part of unmatched */
- if ((vf->flags & CAMEL_STORE_FOLDER_PRIVATE) == 0 && !killun) {
- CAMEL_VEE_FOLDER_LOCK (folder_unmatched, subfolder_lock);
- still = g_list_find (CAMEL_VEE_FOLDER_GET_PRIVATE (folder_unmatched)->folders, source) != NULL;
- CAMEL_VEE_FOLDER_UNLOCK (folder_unmatched, subfolder_lock);
- camel_vee_folder_hash_folder (source, hash);
- }
-
- CAMEL_VEE_FOLDER_LOCK (folder_unmatched, summary_lock);
-
- /* See if we just blow all uid's from this folder away from unmatched, regardless */
- if (killun) {
- start = -1;
- last = -1;
- count = camel_folder_summary_count (((CamelFolder *)folder_unmatched)->summary);
- for (i=0;i<count;i++) {
- CamelVeeMessageInfo *mi = (CamelVeeMessageInfo *)camel_folder_summary_index (((CamelFolder *)folder_unmatched)->summary, i);
-
- if (mi) {
- if (mi->summary == ssummary) {
- camel_folder_change_info_remove_uid (folder_unmatched->changes, camel_message_info_uid (mi));
- if (last == -1) {
- last = start = i;
- } else if (last+1 == i) {
- last = i;
- } else {
- camel_folder_summary_remove_range (((CamelFolder *)folder_unmatched)->summary, start, last);
- i -= (last-start)+1;
- start = last = i;
- }
- }
- camel_message_info_free ((CamelMessageInfo *)mi);
- }
- }
- if (last != -1)
- camel_folder_summary_remove_range (((CamelFolder *)folder_unmatched)->summary, start, last);
- }
- }
-
- /*FIXME: This can be optimized a lot like, searching for UID in the summary uids */
- start = -1;
- last = -1;
- count = camel_folder_summary_count (folder->summary);
- for (i=0;i<count;i++) {
- CamelVeeMessageInfo *mi = (CamelVeeMessageInfo *)camel_folder_summary_index (folder->summary, i);
- if (mi) {
- if (mi->summary == ssummary) {
- const gchar *uid = camel_message_info_uid (mi);
-
- camel_folder_change_info_remove_uid (vf->changes, uid);
-
- if (last == -1) {
- last = start = i;
- } else if (last+1 == i) {
- last = i;
- } else {
- camel_folder_summary_remove_range (folder->summary, start, last);
- i -= (last-start)+1;
- start = last = i;
- }
- if ((vf->flags & CAMEL_STORE_FOLDER_PRIVATE) == 0 && folder_unmatched != NULL) {
- if (still) {
- if (g_hash_table_lookup_extended (unmatched_uids, uid, (gpointer *)&oldkey, &oldval)) {
- n = GPOINTER_TO_INT (oldval);
- if (n == 1) {
- g_hash_table_remove (unmatched_uids, oldkey);
- if (vee_folder_add_uid_test (folder_unmatched, source, oldkey+8, hash)) {
- camel_folder_change_info_add_uid (folder_unmatched->changes, oldkey);
- }
- g_free (oldkey);
- } else {
- g_hash_table_insert (unmatched_uids, oldkey, GINT_TO_POINTER (n-1));
- }
- }
- } else {
- if (g_hash_table_lookup_extended (unmatched_uids, camel_message_info_uid (mi), (gpointer *)&oldkey, &oldval)) {
- g_hash_table_remove (unmatched_uids, oldkey);
- g_free (oldkey);
- }
- }
- }
- }
- camel_message_info_free ((CamelMessageInfo *)mi);
- }
- }
-
- if (last != -1)
- camel_folder_summary_remove_range (folder->summary, start, last);
-
- if (folder_unmatched) {
- if (camel_folder_change_info_changed (folder_unmatched->changes)) {
- unmatched_changes = folder_unmatched->changes;
- folder_unmatched->changes = camel_folder_change_info_new ();
- }
-
- CAMEL_VEE_FOLDER_UNLOCK (folder_unmatched, summary_lock);
- }
-
- if (camel_folder_change_info_changed (vf->changes)) {
- vf_changes = vf->changes;
- vf->changes = camel_folder_change_info_new ();
- }
-
- CAMEL_VEE_FOLDER_UNLOCK (vf, summary_lock);
-
- if (unmatched_changes) {
- camel_object_trigger_event ((CamelObject *)folder_unmatched, "folder_changed", unmatched_changes);
- camel_folder_change_info_free (unmatched_changes);
- }
-
- if (vf_changes) {
- camel_object_trigger_event ((CamelObject *)vf, "folder_changed", vf_changes);
- camel_folder_change_info_free (vf_changes);
- }
-}
-
-static void
vee_folder_finalize (GObject *object)
{
CamelVeeFolder *vf;
@@ -994,10 +858,7 @@ vee_folder_finalize (GObject *object)
vf = CAMEL_VEE_FOLDER (object);
vf->priv->destroyed = TRUE;
- if (vf->parent_vee_store != NULL)
- folder_unmatched = vf->parent_vee_store->folder_unmatched;
- else
- folder_unmatched = NULL;
+ folder_unmatched = vf->parent_vee_store ? vf->parent_vee_store->folder_unmatched : NULL;
/* Save the counts to DB */
if (!vf->deleted) {
@@ -1087,7 +948,7 @@ vee_folder_getv (CamelObject *object,
deleted++;
if (flags & CAMEL_MESSAGE_JUNK) {
junked++;
- if (! (flags & CAMEL_MESSAGE_DELETED))
+ if (!(flags & CAMEL_MESSAGE_DELETED))
junked_not_deleted++;
}
if ((flags & (CAMEL_MESSAGE_DELETED|CAMEL_MESSAGE_JUNK)) == 0)
@@ -1598,6 +1459,145 @@ vee_folder_add_folder (CamelVeeFolder *vee_folder,
}
static void
+vee_folder_remove_folder_helper (CamelVeeFolder *vf, CamelFolder *source)
+{
+ gint i, count, n, still = FALSE, start, last;
+ gchar *oldkey;
+ CamelFolder *folder = (CamelFolder *)vf;
+ gchar hash[8];
+ CamelFolderChangeInfo *vf_changes = NULL, *unmatched_changes = NULL;
+ gpointer oldval;
+ CamelVeeFolder *folder_unmatched = vf->parent_vee_store ? vf->parent_vee_store->folder_unmatched : NULL;
+ GHashTable *unmatched_uids = vf->parent_vee_store ? vf->parent_vee_store->unmatched_uids : NULL;
+ CamelFolderSummary *ssummary = source->summary;
+ gint killun = FALSE;
+
+ if (vf == folder_unmatched)
+ return;
+
+ if ((source->folder_flags & CAMEL_FOLDER_HAS_BEEN_DELETED))
+ killun = TRUE;
+
+ CAMEL_VEE_FOLDER_LOCK (vf, summary_lock);
+
+ if (folder_unmatched != NULL) {
+ /* check if this folder is still to be part of unmatched */
+ if ((vf->flags & CAMEL_STORE_FOLDER_PRIVATE) == 0 && !killun) {
+ CAMEL_VEE_FOLDER_LOCK (folder_unmatched, subfolder_lock);
+ still = g_list_find (CAMEL_VEE_FOLDER_GET_PRIVATE (folder_unmatched)->folders, source) != NULL;
+ CAMEL_VEE_FOLDER_UNLOCK (folder_unmatched, subfolder_lock);
+ camel_vee_folder_hash_folder (source, hash);
+ }
+
+ CAMEL_VEE_FOLDER_LOCK (folder_unmatched, summary_lock);
+
+ /* See if we just blow all uid's from this folder away from unmatched, regardless */
+ if (killun) {
+ start = -1;
+ last = -1;
+ count = camel_folder_summary_count (((CamelFolder *)folder_unmatched)->summary);
+ for (i=0;i<count;i++) {
+ CamelVeeMessageInfo *mi = (CamelVeeMessageInfo *)camel_folder_summary_index (((CamelFolder *)folder_unmatched)->summary, i);
+
+ if (mi) {
+ if (mi->summary == ssummary) {
+ camel_folder_change_info_remove_uid (folder_unmatched->changes, camel_message_info_uid (mi));
+ if (last == -1) {
+ last = start = i;
+ } else if (last+1 == i) {
+ last = i;
+ } else {
+ camel_folder_summary_remove_range (((CamelFolder *)folder_unmatched)->summary, start, last);
+ i -= (last-start)+1;
+ start = last = i;
+ }
+ }
+ camel_message_info_free ((CamelMessageInfo *)mi);
+ }
+ }
+ if (last != -1)
+ camel_folder_summary_remove_range (((CamelFolder *)folder_unmatched)->summary, start, last);
+ }
+ }
+
+ /*FIXME: This can be optimized a lot like, searching for UID in the summary uids */
+ start = -1;
+ last = -1;
+ count = camel_folder_summary_count (folder->summary);
+ for (i=0;i<count;i++) {
+ CamelVeeMessageInfo *mi = (CamelVeeMessageInfo *)camel_folder_summary_index (folder->summary, i);
+ if (mi) {
+ if (mi->summary == ssummary) {
+ const gchar *uid = camel_message_info_uid (mi);
+
+ camel_folder_change_info_remove_uid (vf->changes, uid);
+
+ if (last == -1) {
+ last = start = i;
+ } else if (last+1 == i) {
+ last = i;
+ } else {
+ camel_folder_summary_remove_range (folder->summary, start, last);
+ i -= (last-start)+1;
+ start = last = i;
+ }
+ if ((vf->flags & CAMEL_STORE_FOLDER_PRIVATE) == 0 && folder_unmatched != NULL) {
+ if (still) {
+ if (g_hash_table_lookup_extended (unmatched_uids, uid, (gpointer *)&oldkey, &oldval)) {
+ n = GPOINTER_TO_INT (oldval);
+ if (n == 1) {
+ g_hash_table_remove (unmatched_uids, oldkey);
+ if (vee_folder_add_uid_test (folder_unmatched, source, oldkey+8, hash)) {
+ camel_folder_change_info_add_uid (folder_unmatched->changes, oldkey);
+ }
+ g_free (oldkey);
+ } else {
+ g_hash_table_insert (unmatched_uids, oldkey, GINT_TO_POINTER (n-1));
+ }
+ }
+ } else {
+ if (g_hash_table_lookup_extended (unmatched_uids, camel_message_info_uid (mi), (gpointer *)&oldkey, &oldval)) {
+ g_hash_table_remove (unmatched_uids, oldkey);
+ g_free (oldkey);
+ }
+ }
+ }
+ }
+ camel_message_info_free ((CamelMessageInfo *)mi);
+ }
+ }
+
+ if (last != -1)
+ camel_folder_summary_remove_range (folder->summary, start, last);
+
+ if (folder_unmatched) {
+ if (camel_folder_change_info_changed (folder_unmatched->changes)) {
+ unmatched_changes = folder_unmatched->changes;
+ folder_unmatched->changes = camel_folder_change_info_new ();
+ }
+
+ CAMEL_VEE_FOLDER_UNLOCK (folder_unmatched, summary_lock);
+ }
+
+ if (camel_folder_change_info_changed (vf->changes)) {
+ vf_changes = vf->changes;
+ vf->changes = camel_folder_change_info_new ();
+ }
+
+ CAMEL_VEE_FOLDER_UNLOCK (vf, summary_lock);
+
+ if (unmatched_changes) {
+ camel_object_trigger_event ((CamelObject *)folder_unmatched, "folder_changed", unmatched_changes);
+ camel_folder_change_info_free (unmatched_changes);
+ }
+
+ if (vf_changes) {
+ camel_object_trigger_event ((CamelObject *)vf, "folder_changed", vf_changes);
+ camel_folder_change_info_free (vf_changes);
+ }
+}
+
+static void
vee_folder_remove_folder (CamelVeeFolder *vee_folder,
CamelFolder *sub)
{
@@ -1639,7 +1639,7 @@ vee_folder_rebuild_folder (CamelVeeFolder *vee_folder,
gboolean rebuilded = FALSE;
gchar *shash;
- /* Since the source of a correlating vee_folderolder has to be requeried in
+ /* Since the source of a correlating vfolder has to be requeried in
* full every time it changes, caching the results in the db is not
* worth the effort. Thus, DB use is conditioned on !correlating. */
gboolean correlating = expression_is_correlating (vee_folder->expression);
@@ -1867,10 +1867,8 @@ vee_folder_folder_changed (CamelVeeFolder *vee_folder,
m = camel_session_thread_msg_new (session, &folder_changed_ops, sizeof (*m));
m->changes = camel_folder_change_info_new ();
camel_folder_change_info_cat (m->changes, changes);
- m->sub = sub;
- g_object_ref (sub);
- m->vee_folder = vee_folder;
- g_object_ref (vee_folder);
+ m->sub = g_object_ref (sub);
+ m->vee_folder = g_object_ref (vee_folder);
camel_session_thread_queue (session, &m->msg, 0);
}
@@ -1962,11 +1960,6 @@ camel_vee_folder_init (CamelVeeFolder *vee_folder)
vee_folder->priv->unread_vfolder = -1;
}
-/**
- * camel_vee_folder_mask_event_folder_changed:
- *
- * Since: 2.26
- **/
void
camel_vee_folder_construct (CamelVeeFolder *vf, CamelStore *parent_store, const gchar *full, const gchar *name, guint32 flags)
{
@@ -1989,7 +1982,7 @@ camel_vee_folder_construct (CamelVeeFolder *vf, CamelStore *parent_store, const
*
* Create a new CamelVeeFolder object.
*
- * Return value: A new CamelVeeFolder widget.
+ * Returns: A new CamelVeeFolder widget.
**/
CamelFolder *
camel_vee_folder_new (CamelStore *parent_store, const gchar *full, guint32 flags)
@@ -2024,11 +2017,6 @@ camel_vee_folder_new (CamelStore *parent_store, const gchar *full, guint32 flags
return (CamelFolder *)vf;
}
-/**
- * camel_vee_folder_unmask_event_folder_changed:
- *
- * Since: 2.26
- **/
void
camel_vee_folder_set_expression (CamelVeeFolder *vf, const gchar *query)
{
@@ -2058,8 +2046,8 @@ camel_vee_folder_add_folder (CamelVeeFolder *vf, CamelFolder *sub)
/* for normal vfolders we want only unique ones, for unmatched we want them all recorded */
if (g_list_find (p->folders, sub) == NULL) {
- g_object_ref (sub);
- p->folders = g_list_append (p->folders, sub);
+ p->folders = g_list_append (
+ p->folders, g_object_ref (sub));
CAMEL_FOLDER_LOCK (vf, change_lock);
@@ -2071,8 +2059,8 @@ camel_vee_folder_add_folder (CamelVeeFolder *vf, CamelFolder *sub)
}
if ((vf->flags & CAMEL_STORE_FOLDER_PRIVATE) == 0 && !CAMEL_IS_VEE_FOLDER (sub) && folder_unmatched != NULL) {
CamelVeeFolderPrivate *up = CAMEL_VEE_FOLDER_GET_PRIVATE (folder_unmatched);
- g_object_ref (sub);
- up->folders = g_list_append (up->folders, sub);
+ up->folders = g_list_append (
+ up->folders, g_object_ref (sub));
CAMEL_FOLDER_LOCK (folder_unmatched, change_lock);
@@ -2102,7 +2090,6 @@ camel_vee_folder_add_folder (CamelVeeFolder *vf, CamelFolder *sub)
* Removed the source folder, @sub, from the virtual folder, @vf.
**/
void
-
camel_vee_folder_remove_folder (CamelVeeFolder *vf, CamelFolder *sub)
{
CamelVeeFolderPrivate *p = CAMEL_VEE_FOLDER_GET_PRIVATE (vf);
@@ -2288,7 +2275,7 @@ camel_vee_folder_hash_folder (CamelFolder *folder, gchar buffer[8])
*
* Find the real folder (and uid)
*
- * Return value:
+ * Returns:
**/
CamelFolder *
camel_vee_folder_get_location (CamelVeeFolder *vf, const CamelVeeMessageInfo *vinfo, gchar **realuid)
@@ -2315,6 +2302,11 @@ camel_vee_folder_get_location (CamelVeeFolder *vf, const CamelVeeMessageInfo *vi
}
}
+/**
+ * camel_vee_folder_mask_event_folder_changed:
+ *
+ * Since: 2.26
+ **/
void
camel_vee_folder_mask_event_folder_changed (CamelVeeFolder *vf, CamelFolder *sub)
{
@@ -2322,12 +2314,22 @@ camel_vee_folder_mask_event_folder_changed (CamelVeeFolder *vf, CamelFolder *sub
}
+/**
+ * camel_vee_folder_unmask_event_folder_changed:
+ *
+ * Since: 2.26
+ **/
void
camel_vee_folder_unmask_event_folder_changed (CamelVeeFolder *vf, CamelFolder *sub)
{
camel_object_hook_event ((CamelObject *)sub, "folder_changed", (CamelObjectEventHookFunc) folder_changed, vf);
}
+/**
+ * camel_vee_folder_sync_headers:
+ *
+ * Since: 2.24
+ **/
void
camel_vee_folder_sync_headers (CamelFolder *vf,
GError **error)
diff --git a/camel/camel-vtrash-folder.c b/camel/camel-vtrash-folder.c
index cde904b..bc92d56 100644
--- a/camel/camel-vtrash-folder.c
+++ b/camel/camel-vtrash-folder.c
@@ -242,8 +242,7 @@ vtrash_folder_transfer_messages_to (CamelFolder *source,
md = g_hash_table_lookup(batch, mi->summary->folder);
if (md == NULL) {
md = g_malloc0(sizeof(*md));
- md->folder = mi->summary->folder;
- g_object_ref (md->folder);
+ md->folder = g_object_ref (mi->summary->folder);
md->uids = g_ptr_array_new();
md->dest = dest;
g_hash_table_insert(batch, mi->summary->folder, md);
diff --git a/camel/providers/groupwise/camel-groupwise-folder.c b/camel/providers/groupwise/camel-groupwise-folder.c
index b53c3a2..f4b4715 100644
--- a/camel/providers/groupwise/camel-groupwise-folder.c
+++ b/camel/providers/groupwise/camel-groupwise-folder.c
@@ -673,14 +673,25 @@ move_to_junk (CamelFolder *folder, CamelMessageInfo *info, GError **error)
static gboolean
groupwise_sync_summary (CamelFolder *folder, GError **error)
{
+ CamelStoreInfo *si;
+ guint32 unread, total;
+
camel_folder_summary_save_to_db (folder->summary, NULL);
+
+ si = camel_store_summary_path ((CamelStoreSummary *) ((CamelGroupwiseStore *) folder->parent_store)->summary, folder->full_name);
+ camel_object_get(folder, NULL, CAMEL_FOLDER_TOTAL, &total, CAMEL_FOLDER_UNREAD, &unread, NULL);
+
+ if (si) {
+ si->unread = unread;
+ si->total = total;
+ }
+
camel_store_summary_touch ((CamelStoreSummary *)((CamelGroupwiseStore *)folder->parent_store)->summary);
camel_store_summary_save ((CamelStoreSummary *)((CamelGroupwiseStore *)folder->parent_store)->summary);
return TRUE;
}
-/* This may need to be reorganized. */
static void
sync_flags (CamelFolder *folder, GList *uids)
{
@@ -757,10 +768,8 @@ groupwise_sync (CamelFolder *folder, gboolean expunge, CamelMessageInfo *update_
deleted_items = deleted_head = NULL;
- if (((CamelOfflineStore *) gw_store)->state == CAMEL_OFFLINE_STORE_NETWORK_UNAVAIL ||
- ((CamelService *)gw_store)->status == CAMEL_SERVICE_DISCONNECTED) {
+ if (((CamelOfflineStore *) gw_store)->state == CAMEL_OFFLINE_STORE_NETWORK_UNAVAIL)
return groupwise_sync_summary (folder, error);
- }
CAMEL_SERVICE_REC_LOCK (gw_store, connect_lock);
if (!camel_groupwise_store_connected (gw_store, NULL)) {
@@ -968,6 +977,9 @@ groupwise_sync (CamelFolder *folder, gboolean expunge, CamelMessageInfo *update_
CAMEL_SERVICE_REC_LOCK (gw_store, connect_lock);
success = groupwise_sync_summary (folder, error);
CAMEL_SERVICE_REC_UNLOCK (gw_store, connect_lock);
+
+ camel_object_trigger_event (CAMEL_OBJECT (folder), "folder_changed", changes);
+ camel_folder_change_info_free (changes);
return success;
}
@@ -1159,7 +1171,6 @@ update_free (CamelSession *session, CamelSessionThreadMsg *msg)
g_free (m->t_str);
g_free (m->container_id);
g_object_unref (m->folder);
- camel_folder_thaw (m->folder);
g_slist_foreach (m->slist, (GFunc) g_free, NULL);
g_slist_free (m->slist);
m->slist = NULL;
@@ -1287,7 +1298,7 @@ update_summary_string (CamelFolder *folder, const gchar *time_string, GError **e
((CamelGroupwiseSummary *) folder->summary)->time_string = g_strdup (time_string);
camel_folder_summary_touch (folder->summary);
- groupwise_sync_summary (folder, error);
+ camel_folder_summary_save_to_db (folder->summary, NULL);
}
static void
@@ -1464,9 +1475,7 @@ groupwise_refresh_folder(CamelFolder *folder, GError **error)
msg->cnc = cnc;
msg->t_str = g_strdup (old_sync_time);
msg->container_id = g_strdup (container_id);
- msg->folder = folder;
- g_object_ref (folder);
- camel_folder_freeze (folder);
+ msg->folder = g_object_ref (folder);
camel_session_thread_queue (session, &msg->msg, 0);
/*thread creation and queueing done*/
}
@@ -1627,8 +1636,10 @@ gw_update_cache (CamelFolder *folder, GList *list, GError **error, gboolean uid_
item_status = e_gw_item_get_item_status (item);
/* skip the deleted items */
- if (item_status & E_GW_ITEM_STAT_DELETED)
+ if (item_status & E_GW_ITEM_STAT_DELETED && strcmp (folder->full_name, "Trash")) {
+ i++;
continue;
+ }
mi = NULL;
pmi = NULL;
@@ -1824,7 +1835,7 @@ get_from_from_org (EGwItemOrganizer *org)
/* Update summary, if there is none existing, create one */
void
-gw_update_summary ( CamelFolder *folder, GList *list,GError **error)
+gw_update_summary (CamelFolder *folder, GList *list,GError **error)
{
CamelGroupwiseMessageInfo *mi = NULL;
CamelGroupwiseStore *gw_store = CAMEL_GROUPWISE_STORE (folder->parent_store);
@@ -2550,7 +2561,7 @@ groupwise_transfer_messages_to (CamelFolder *source, GPtrArray *uids,
}
if (delete_originals) {
- if ( !strcmp(source->full_name, SENT) ) {
+ if (!strcmp(source->full_name, SENT)) {
g_set_error (
error, CAMEL_SERVICE_ERROR,
CAMEL_SERVICE_ERROR_UNAVAILABLE,
diff --git a/camel/providers/groupwise/camel-groupwise-store.c b/camel/providers/groupwise/camel-groupwise-store.c
index 3ab3fa1..7ff0a7b 100644
--- a/camel/providers/groupwise/camel-groupwise-store.c
+++ b/camel/providers/groupwise/camel-groupwise-store.c
@@ -45,6 +45,11 @@
#include "camel-groupwise-summary.h"
#include "camel-groupwise-utils.h"
+#ifdef G_OS_WIN32
+#include <winsock2.h>
+#include <ws2tcpip.h>
+#endif
+
#define d(x)
#define CURSOR_ITEM_LIMIT 100
#define JUNK_ENABLE 1
@@ -276,10 +281,8 @@ groupwise_store_set_current_folder (CamelGroupwiseStore *groupwise_store, CamelF
groupwise_store->current_folder = NULL;
}
- if (folder) {
- g_object_ref (folder);
- groupwise_store->current_folder = folder;
- }
+ if (folder)
+ groupwise_store->current_folder = g_object_ref (folder);
CAMEL_SERVICE_REC_UNLOCK (groupwise_store, connect_lock);
}
@@ -953,13 +956,6 @@ groupwise_folders_sync (CamelGroupwiseStore *store, GError **error)
CamelStoreInfo *si = NULL;
gint count, i;
- if (!priv->cnc && ((CamelOfflineStore *) store)->state == CAMEL_OFFLINE_STORE_NETWORK_AVAIL) {
- if (((CamelService *)store)->status == CAMEL_SERVICE_DISCONNECTED) {
- ((CamelService *)store)->status = CAMEL_SERVICE_CONNECTING;
- groupwise_connect ((CamelService *)store, error);
- }
- }
-
status = e_gw_connection_get_container_list (priv->cnc, "folders", &folder_list);
if (status == E_GW_CONNECTION_STATUS_INVALID_CONNECTION)
status = e_gw_connection_get_container_list (priv->cnc, "folders", &folder_list);
@@ -1467,6 +1463,12 @@ camel_groupwise_store_connected (CamelGroupwiseStore *store, GError **error)
{
if (((CamelOfflineStore *) store)->state == CAMEL_OFFLINE_STORE_NETWORK_AVAIL
&& camel_service_connect ((CamelService *)store, error)) {
+ CamelGroupwiseStore *gw_store = (CamelGroupwiseStore *) store;
+ CamelGroupwiseStorePrivate *priv = gw_store->priv;
+
+ if (g_hash_table_size (priv->name_hash) == 0)
+ groupwise_folders_sync ((CamelGroupwiseStore *) gw_store, NULL);
+
return TRUE;
}
/*Not online, so return FALSE*/
diff --git a/camel/providers/groupwise/camel-groupwise-transport.c b/camel/providers/groupwise/camel-groupwise-transport.c
index 5c76ddd..abebfa0 100644
--- a/camel/providers/groupwise/camel-groupwise-transport.c
+++ b/camel/providers/groupwise/camel-groupwise-transport.c
@@ -36,12 +36,6 @@
#define REPLY_VIEW "default message attachments threading"
-static gboolean groupwise_send_to (CamelTransport *transport,
- CamelMimeMessage *message,
- CamelAddress *from,
- CamelAddress *recipients,
- GError **error);
-
G_DEFINE_TYPE (CamelGroupwiseTransport, camel_groupwise_transport, CAMEL_TYPE_TRANSPORT)
static gboolean
diff --git a/camel/providers/groupwise/camel-groupwise-utils.c b/camel/providers/groupwise/camel-groupwise-utils.c
index dfe15ac..9f829b6 100644
--- a/camel/providers/groupwise/camel-groupwise-utils.c
+++ b/camel/providers/groupwise/camel-groupwise-utils.c
@@ -282,7 +282,7 @@ send_as_attachment (EGwConnection *cnc, EGwItem *item, CamelStream *content, Cam
EGwConnectionStatus status;
EGwItemAttachment *attachment;
EGwItem *temp_item;
- GByteArray *buffer;
+ GByteArray *byte_array;
attachment = g_new0 (EGwItemAttachment, 1);
attachment->contentType = camel_content_type_simple (type);
@@ -290,29 +290,29 @@ send_as_attachment (EGwConnection *cnc, EGwItem *item, CamelStream *content, Cam
if (cid)
attachment->contentid = camel_header_contentid_decode (cid);
- buffer = camel_stream_mem_get_byte_array (CAMEL_STREAM_MEM (content));
+ byte_array = camel_stream_mem_get_byte_array (CAMEL_STREAM_MEM (content));
- if (filename && buffer->data) {
+ if (filename && byte_array->data) {
if (camel_content_type_is (type, "application", "pgp-signature")) {
gchar *temp_str;
gint temp_len;
- temp_str = g_base64_encode (buffer->data, buffer->len);
+ temp_str = g_base64_encode (byte_array->data, byte_array->len);
temp_len = strlen (temp_str);
attachment->data = g_strdup (temp_str);
attachment->size = temp_len;
g_free (temp_str);
temp_str = NULL;
} else {
- attachment->data = g_base64_encode(buffer->data, buffer->len);
+ attachment->data = g_base64_encode(byte_array->data, byte_array->len);
attachment->size = strlen (attachment->data);
}
- } else if (buffer->data) {
+ } else if (byte_array->data) {
gchar *temp_str;
gint temp_len;
if (!strcmp (attachment->contentType, "multipart/digest")) {
/* FIXME? */
} else {
- temp_str = g_base64_encode (buffer->data, buffer->len);
+ temp_str = g_base64_encode (byte_array->data, byte_array->len);
temp_len = strlen (temp_str);
attachment->data = g_strdup (temp_str);
attachment->size = temp_len;
@@ -415,10 +415,10 @@ camel_groupwise_util_item_from_message (EGwConnection *cnc, CamelMimeMessage *me
CamelStream *content;
CamelDataWrapper *dw = NULL;
CamelContentType *type;
- GByteArray *buffer;
+ GByteArray *byte_array;
- buffer = g_byte_array_new ();
- content = camel_stream_mem_new_with_byte_array (buffer);
+ byte_array = g_byte_array_new ();
+ content = camel_stream_mem_new_with_byte_array (byte_array);
dw = camel_medium_get_content (CAMEL_MEDIUM (message));
type = camel_mime_part_get_content_type((CamelMimePart *)message);
@@ -441,8 +441,7 @@ camel_groupwise_util_item_from_message (EGwConnection *cnc, CamelMimeMessage *me
g_object_unref (filter);
} else {
/* US-ASCII or UTF-8 */
- filtered_stream = content;
- g_object_ref (content);
+ filtered_stream = g_object_ref (content);
}
camel_data_wrapper_decode_to_stream (dw, filtered_stream, NULL);
@@ -450,9 +449,9 @@ camel_groupwise_util_item_from_message (EGwConnection *cnc, CamelMimeMessage *me
g_object_unref (filtered_stream);
camel_stream_write (content, "", 1, NULL);
- e_gw_item_set_message (item, (const gchar *)buffer->data);
+ e_gw_item_set_message (item, (const gchar *)byte_array->data);
} else {
- camel_data_wrapper_decode_to_stream (dw, (CamelStream *) content, NULL);
+ camel_data_wrapper_decode_to_stream (dw, content, NULL);
send_as_attachment (cnc, item, content, type, dw, NULL, NULL, &attach_list);
}
@@ -677,8 +676,7 @@ do_multipart (EGwConnection *cnc, EGwItem *item, CamelMultipart *mp, GSList **at
g_object_unref (filter);
} else {
/* US-ASCII or UTF-8 */
- filtered_stream = content;
- g_object_ref (content);
+ filtered_stream = g_object_ref (content);
}
camel_data_wrapper_decode_to_stream (dw, filtered_stream, NULL);
@@ -686,7 +684,7 @@ do_multipart (EGwConnection *cnc, EGwItem *item, CamelMultipart *mp, GSList **at
g_object_unref (filtered_stream);
camel_stream_write (content, "", 1, NULL);
- e_gw_item_set_message (item, (const gchar *)buffer->data);
+ e_gw_item_set_message (item, (const gchar *) buffer->data);
} else {
filename = camel_mime_part_get_filename (part);
disposition = camel_mime_part_get_disposition (part);
diff --git a/camel/providers/imap/camel-imap-folder.c b/camel/providers/imap/camel-imap-folder.c
index 8bf6e57..b557117 100644
--- a/camel/providers/imap/camel-imap-folder.c
+++ b/camel/providers/imap/camel-imap-folder.c
@@ -4237,7 +4237,7 @@ done:
*/
static GPtrArray *
imap_get_uncached_uids (CamelFolder *folder,
- GPtrArray * uids,
+ GPtrArray *uids,
GError **error)
{
GPtrArray *result;
diff --git a/camel/providers/imap/camel-imap-search.c b/camel/providers/imap/camel-imap-search.c
index 5ce3b4d..178b388 100644
--- a/camel/providers/imap/camel-imap-search.c
+++ b/camel/providers/imap/camel-imap-search.c
@@ -129,7 +129,7 @@ imap_search_finalize (GObject *object)
search = CAMEL_IMAP_SEARCH (object);
- while ( (mr = (struct _match_record *)camel_dlist_remtail(&search->matches)) )
+ while ((mr = (struct _match_record *)camel_dlist_remtail(&search->matches)))
free_match (search, mr);
g_hash_table_destroy (search->matches_hash);
diff --git a/camel/providers/imap/camel-imap-store-summary.c b/camel/providers/imap/camel-imap-store-summary.c
index e491845..838c41b 100644
--- a/camel/providers/imap/camel-imap-store-summary.c
+++ b/camel/providers/imap/camel-imap-store-summary.c
@@ -61,7 +61,6 @@ camel_imap_store_summary_class_init (CamelImapStoreSummaryClass *class)
store_summary_class = CAMEL_STORE_SUMMARY_CLASS (class);
store_summary_class->summary_header_load = summary_header_load;
store_summary_class->summary_header_save = summary_header_save;
- /*store_summary_class->store_info_new = store_info_new;*/
store_summary_class->store_info_load = store_info_load;
store_summary_class->store_info_save = store_info_save;
store_summary_class->store_info_free = store_info_free;
diff --git a/camel/providers/imap/camel-imap-store.c b/camel/providers/imap/camel-imap-store.c
index d7835c5..80f69c0 100644
--- a/camel/providers/imap/camel-imap-store.c
+++ b/camel/providers/imap/camel-imap-store.c
@@ -45,6 +45,11 @@
#include "camel-imap-summary.h"
#include "camel-imap-utils.h"
+#ifdef G_OS_WIN32
+#include <winsock2.h>
+#include <ws2tcpip.h>
+#endif
+
#define d(x)
/* Specified in RFC 2060 */
@@ -2027,8 +2032,7 @@ get_folder (CamelStore *store, const gchar *folder_name, guint32 flags, GError *
new_folder = camel_imap_folder_new (store, folder_name, folder_dir, error);
g_free (folder_dir);
if (new_folder) {
- imap_store->current_folder = new_folder;
- g_object_ref (new_folder);
+ imap_store->current_folder = g_object_ref (new_folder);
if (!camel_imap_folder_selected (new_folder, response, error)) {
g_object_unref (imap_store->current_folder);
@@ -2116,7 +2120,9 @@ delete_folder (CamelStore *store,
if (response) {
camel_imap_response_free (imap_store, response);
imap_forget_folder (imap_store, folder_name, error);
- }
+ } else
+ success = FALSE;
+
fail:
CAMEL_SERVICE_REC_UNLOCK(imap_store, connect_lock);
@@ -2756,20 +2762,19 @@ refresh_refresh(CamelSession *session, CamelSessionThreadMsg *msg)
CAMEL_SERVICE_REC_LOCK (store, connect_lock);
- if (!camel_imap_store_connected((CamelImapStore *)m->store, &m->error))
+ if (!camel_imap_store_connected (store, &m->error))
goto done;
if (store->users_namespace && store->users_namespace[0]) {
- get_folders_sync (store, "INBOX", &m->error);
- if (m->error != NULL)
+ if (!get_folders_sync (store, "INBOX", &m->error))
goto done;
} else {
get_folders_sync (store, "*", &m->error);
}
/* look in all namespaces */
- get_folders_sync((CamelImapStore *)m->store, NULL, &m->error);
- camel_store_summary_save((CamelStoreSummary *)((CamelImapStore *)m->store)->summary);
+ get_folders_sync (store, NULL, &m->error);
+ camel_store_summary_save ((CamelStoreSummary *)store->summary);
done:
CAMEL_SERVICE_REC_UNLOCK (store, connect_lock);
}
@@ -2828,8 +2833,7 @@ get_folder_info (CamelStore *store,
imap_store->refresh_stamp = now;
m = camel_session_thread_msg_new(((CamelService *)store)->session, &refresh_ops, sizeof(*m));
- m->store = store;
- g_object_ref (store);
+ m->store = g_object_ref (store);
camel_session_thread_queue(((CamelService *)store)->session, &m->msg, 0);
}
CAMEL_SERVICE_REC_UNLOCK(store, connect_lock);
diff --git a/camel/providers/imap/camel-imap-wrapper.c b/camel/providers/imap/camel-imap-wrapper.c
index 6b87bb4..9a0b346 100644
--- a/camel/providers/imap/camel-imap-wrapper.c
+++ b/camel/providers/imap/camel-imap-wrapper.c
@@ -50,8 +50,7 @@ imap_wrapper_hydrate (CamelImapWrapper *imap_wrapper,
{
CamelDataWrapper *data_wrapper = (CamelDataWrapper *) imap_wrapper;
- g_object_ref (stream);
- data_wrapper->stream = stream;
+ data_wrapper->stream = g_object_ref (stream);
data_wrapper->offline = FALSE;
g_object_unref (imap_wrapper->folder);
@@ -159,14 +158,11 @@ camel_imap_wrapper_new (CamelImapFolder *imap_folder,
gboolean sync_offline = FALSE;
imap_wrapper = g_object_new (CAMEL_TYPE_IMAP_WRAPPER, NULL);
-
- imap_wrapper = (CamelImapWrapper *)g_object_new (camel_imap_wrapper_get_type(), NULL);
camel_data_wrapper_set_mime_type_field (CAMEL_DATA_WRAPPER (imap_wrapper), type);
((CamelDataWrapper *)imap_wrapper)->offline = !sync_offline;
((CamelDataWrapper *)imap_wrapper)->encoding = encoding;
- imap_wrapper->folder = imap_folder;
- g_object_ref (imap_folder);
+ imap_wrapper->folder = g_object_ref (imap_folder);
imap_wrapper->uid = g_strdup (uid);
imap_wrapper->part_spec = g_strdup (part_spec);
diff --git a/camel/providers/local/camel-local-folder.c b/camel/providers/local/camel-local-folder.c
index 34bd9ac..ee7217c 100644
--- a/camel/providers/local/camel-local-folder.c
+++ b/camel/providers/local/camel-local-folder.c
@@ -493,14 +493,12 @@ local_refresh_info(CamelFolder *folder, GError **error)
return FALSE;
}
- CAMEL_FOLDER_REC_UNLOCK(folder, lock);
if (camel_folder_change_info_changed(lf->changes)) {
camel_object_trigger_event((CamelObject *)folder, "folder_changed", lf->changes);
camel_folder_change_info_clear(lf->changes);
}
return TRUE;
-
}
static GPtrArray *
diff --git a/camel/providers/local/camel-local-private.h b/camel/providers/local/camel-local-private.h
index c958e92..2b3f7db 100644
--- a/camel/providers/local/camel-local-private.h
+++ b/camel/providers/local/camel-local-private.h
@@ -31,7 +31,6 @@
#endif
#include <glib.h>
-#include <pthread.h>
G_BEGIN_DECLS
diff --git a/camel/providers/local/camel-local-store.c b/camel/providers/local/camel-local-store.c
index 736ae75..c0666da 100644
--- a/camel/providers/local/camel-local-store.c
+++ b/camel/providers/local/camel-local-store.c
@@ -172,7 +172,7 @@ get_folder(CamelStore * store, const gchar *folder_name, guint32 flags, GError *
}
/* need to create the dir heirarchy */
- if (g_mkdir_with_parents (path, 0777) == -1 && errno != EEXIST) {
+ if (g_mkdir_with_parents (path, 0700) == -1 && errno != EEXIST) {
g_set_error (
error, G_FILE_ERROR,
g_file_error_from_errno (errno),
diff --git a/camel/providers/local/camel-maildir-folder.c b/camel/providers/local/camel-maildir-folder.c
index 9ba5062..8c6487e 100644
--- a/camel/providers/local/camel-maildir-folder.c
+++ b/camel/providers/local/camel-maildir-folder.c
@@ -421,6 +421,7 @@ maildir_transfer_messages_to (CamelFolder *source,
error, CAMEL_ERROR,
CAMEL_ERROR_SYSTEM,
_("Cannot transfer message to destination folder"));
+ camel_message_info_free (info);
break;
}
} else {
diff --git a/camel/providers/local/camel-maildir-store.c b/camel/providers/local/camel-maildir-store.c
index d58f795..a700a1a 100644
--- a/camel/providers/local/camel-maildir-store.c
+++ b/camel/providers/local/camel-maildir-store.c
@@ -99,7 +99,7 @@ maildir_compare_folder_name (gconstpointer a,
}
static CamelFolder *
-get_folder (CamelStore * store,
+get_folder (CamelStore *store,
const gchar *folder_name,
guint32 flags,
GError **error)
@@ -210,7 +210,7 @@ get_inbox (CamelStore *store,
}
static gboolean
-delete_folder (CamelStore * store,
+delete_folder (CamelStore *store,
const gchar *folder_name,
GError **error)
{
diff --git a/camel/providers/local/camel-mbox-store.c b/camel/providers/local/camel-mbox-store.c
index 907f9a9..ecda11f 100644
--- a/camel/providers/local/camel-mbox-store.c
+++ b/camel/providers/local/camel-mbox-store.c
@@ -155,7 +155,7 @@ get_folder (CamelStore *store,
g_free (basename);
dirname = g_path_get_dirname(name);
- if (g_mkdir_with_parents(dirname, 0777) == -1 && errno != EEXIST) {
+ if (g_mkdir_with_parents(dirname, 0700) == -1 && errno != EEXIST) {
g_set_error (
error, G_FILE_ERROR,
g_file_error_from_errno (errno),
diff --git a/camel/providers/local/camel-mbox-summary.c b/camel/providers/local/camel-mbox-summary.c
index de52ce7..a8d6f3c 100644
--- a/camel/providers/local/camel-mbox-summary.c
+++ b/camel/providers/local/camel-mbox-summary.c
@@ -142,7 +142,6 @@ camel_mbox_summary_class_init (CamelMboxSummaryClass *class)
folder_summary_class->message_info_load = message_info_load;
folder_summary_class->message_info_save = message_info_save;
folder_summary_class->meta_message_info_save = meta_message_info_save;
- /*folder_summary_class->message_info_free = message_info_free;*/
folder_summary_class->info_set_user_flag = mbox_info_set_user_flag;
folder_summary_class->info_set_user_tag = mbox_info_set_user_tag;
#ifdef STATUS_PINE
diff --git a/camel/providers/local/camel-mh-folder.c b/camel/providers/local/camel-mh-folder.c
index 2e6041b..cd22fe8 100644
--- a/camel/providers/local/camel-mh-folder.c
+++ b/camel/providers/local/camel-mh-folder.c
@@ -35,6 +35,7 @@
#include <glib/gi18n-lib.h>
#include "camel-mh-folder.h"
+#include "camel-mh-store.h"
#include "camel-mh-summary.h"
#define d(x) /*(printf("%s(%d): ", __FILE__, __LINE__),(x))*/
diff --git a/camel/providers/local/camel-mh-summary.c b/camel/providers/local/camel-mh-summary.c
index 8dd869e..19bf5d4 100644
--- a/camel/providers/local/camel-mh-summary.c
+++ b/camel/providers/local/camel-mh-summary.c
@@ -73,7 +73,6 @@ camel_mh_summary_class_init (CamelMhSummaryClass *class)
local_summary_class = CAMEL_LOCAL_SUMMARY_CLASS (class);
local_summary_class->check = mh_summary_check;
local_summary_class->sync = mh_summary_sync;
- /*local_summary_class->add = mh_summary_add;*/
}
static void
diff --git a/camel/providers/local/camel-spool-summary.c b/camel/providers/local/camel-spool-summary.c
index bd08422..2c36b6d 100644
--- a/camel/providers/local/camel-spool-summary.c
+++ b/camel/providers/local/camel-spool-summary.c
@@ -233,7 +233,7 @@ spool_summary_sync_full (CamelMboxSummary *cls,
error, G_FILE_ERROR,
g_file_error_from_errno (errno),
_("Could not sync spool folder %s: %s\n"
- "Folder may be corrupt, copy saved in '%s'"),
+ "Folder may be corrupt, copy saved in '%s'"),
((CamelLocalSummary *)cls)->folder_path,
g_strerror (errno), tmpname);
/* so we dont delete it */
diff --git a/camel/providers/nntp/camel-nntp-folder.c b/camel/providers/nntp/camel-nntp-folder.c
index 5226617..2f93973 100644
--- a/camel/providers/nntp/camel-nntp-folder.c
+++ b/camel/providers/nntp/camel-nntp-folder.c
@@ -167,8 +167,7 @@ nntp_folder_download_message (CamelNNTPFolder *nntp_folder, const gchar *id, con
if (camel_stream_reset (stream, error) == -1)
goto fail;
} else {
- stream = (CamelStream *) nntp_store->stream;
- g_object_ref (stream);
+ stream = g_object_ref (nntp_store->stream);
}
} else if (ret == 423 || ret == 430) {
g_set_error (
diff --git a/camel/providers/nntp/camel-nntp-newsrc.c b/camel/providers/nntp/camel-nntp-newsrc.c
index f9a6e37..f999741 100644
--- a/camel/providers/nntp/camel-nntp-newsrc.c
+++ b/camel/providers/nntp/camel-nntp-newsrc.c
@@ -26,7 +26,6 @@
#include <errno.h>
#include <fcntl.h>
-#include <pthread.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
diff --git a/camel/providers/nntp/camel-nntp-store-summary.h b/camel/providers/nntp/camel-nntp-store-summary.h
index 8cd598a..a9858c3 100644
--- a/camel/providers/nntp/camel-nntp-store-summary.h
+++ b/camel/providers/nntp/camel-nntp-store-summary.h
@@ -69,7 +69,6 @@ struct _CamelNNTPStoreInfo {
struct _CamelNNTPStoreSummary {
CamelStoreSummary summary;
-
CamelNNTPStoreSummaryPrivate *priv;
/* header info */
diff --git a/camel/providers/nntp/camel-nntp-store.c b/camel/providers/nntp/camel-nntp-store.c
index 51a31b4..f47bf3c 100644
--- a/camel/providers/nntp/camel-nntp-store.c
+++ b/camel/providers/nntp/camel-nntp-store.c
@@ -43,6 +43,11 @@
#include "camel-nntp-private.h"
#include "camel-nntp-resp-codes.h"
+#ifdef G_OS_WIN32
+#include <winsock2.h>
+#include <ws2tcpip.h>
+#endif
+
#define w(x)
#define dd(x) (camel_debug("nntp")?(x):0)
@@ -1250,7 +1255,7 @@ camel_nntp_try_authenticate (CamelNNTPStore *store, GError **error)
gint
camel_nntp_raw_commandv (CamelNNTPStore *store, GError **error, gchar **line, const gchar *fmt, va_list ap)
{
- GByteArray *buffer;
+ GByteArray *byte_array;
const guchar *p, *ps;
guchar c;
gchar *s;
@@ -1305,14 +1310,14 @@ camel_nntp_raw_commandv (CamelNNTPStore *store, GError **error, gchar **line, co
camel_stream_write ((CamelStream *) store->mem, (const gchar *) ps, p-ps-1, NULL);
camel_stream_write ((CamelStream *) store->mem, "\r\n", 2, NULL);
- buffer = camel_stream_mem_get_byte_array (store->mem);
+ byte_array = camel_stream_mem_get_byte_array (store->mem);
- if (camel_stream_write((CamelStream *) store->stream, (const gchar *) buffer->data, buffer->len, error) == -1)
+ if (camel_stream_write((CamelStream *) store->stream, (const gchar *) byte_array->data, byte_array->len, error) == -1)
goto ioerror;
/* FIXME: hack */
camel_stream_reset ((CamelStream *) store->mem, NULL);
- g_byte_array_set_size (buffer, 0);
+ g_byte_array_set_size (byte_array, 0);
if (camel_nntp_stream_line (store->stream, (guchar **) line, &u, error) == -1)
goto ioerror;
diff --git a/camel/providers/nntp/camel-nntp-stream.c b/camel/providers/nntp/camel-nntp-stream.c
index 3165946..3c7f0b3 100644
--- a/camel/providers/nntp/camel-nntp-stream.c
+++ b/camel/providers/nntp/camel-nntp-stream.c
@@ -385,7 +385,9 @@ camel_nntp_stream_gets (CamelNNTPStream *is,
return end == NULL?1:0;
}
-void camel_nntp_stream_set_mode (CamelNNTPStream *is, camel_nntp_stream_mode_t mode)
+void
+camel_nntp_stream_set_mode (CamelNNTPStream *is,
+ camel_nntp_stream_mode_t mode)
{
is->mode = mode;
}
diff --git a/camel/providers/nntp/camel-nntp-summary.c b/camel/providers/nntp/camel-nntp-summary.c
index 11dde96..1cea760 100644
--- a/camel/providers/nntp/camel-nntp-summary.c
+++ b/camel/providers/nntp/camel-nntp-summary.c
@@ -95,7 +95,7 @@ camel_nntp_summary_init (CamelNNTPSummary *nntp_summary)
}
CamelNNTPSummary *
-camel_nntp_summary_new (struct _CamelFolder *folder, const gchar *path)
+camel_nntp_summary_new (CamelFolder *folder, const gchar *path)
{
CamelNNTPSummary *cns;
diff --git a/camel/providers/nntp/camel-nntp-summary.h b/camel/providers/nntp/camel-nntp-summary.h
index bf4a4df..c032f0e 100644
--- a/camel/providers/nntp/camel-nntp-summary.h
+++ b/camel/providers/nntp/camel-nntp-summary.h
@@ -54,7 +54,6 @@ typedef struct _CamelNNTPSummaryPrivate CamelNNTPSummaryPrivate;
struct _CamelNNTPSummary {
CamelFolderSummary parent;
-
CamelNNTPSummaryPrivate *priv;
guint32 version;
diff --git a/camel/providers/pop3/camel-pop3-folder.c b/camel/providers/pop3/camel-pop3-folder.c
index 9d70ee2..8958974 100644
--- a/camel/providers/pop3/camel-pop3-folder.c
+++ b/camel/providers/pop3/camel-pop3-folder.c
@@ -432,7 +432,7 @@ camel_pop3_delete_old (CamelFolder *folder,
message = pop3_get_message (folder, fi->uid, error);
if (message) {
message_time = message->date + message->date_offset;
- g_object_unref(message);
+ g_object_unref (message);
}
}
@@ -618,8 +618,7 @@ pop3_get_message (CamelFolder *folder, const gchar *uid, GError **error)
stream = camel_stream_mem_new();
/* ref it, the cache storage routine unref's when done */
- g_object_ref (stream);
- fi->stream = stream;
+ fi->stream = g_object_ref (stream);
fi->err = EIO;
pcr = camel_pop3_engine_command_new(pop3_store->engine, CAMEL_POP3_COMMAND_MULTI, cmd_tocache, fi, "RETR %u\r\n", fi->id);
diff --git a/camel/providers/pop3/camel-pop3-store.c b/camel/providers/pop3/camel-pop3-store.c
index 1c74c36..20ad95b 100644
--- a/camel/providers/pop3/camel-pop3-store.c
+++ b/camel/providers/pop3/camel-pop3-store.c
@@ -40,6 +40,11 @@
#include "camel-pop3-folder.h"
#include "camel-pop3-store.h"
+#ifdef G_OS_WIN32
+#include <winsock2.h>
+#include <ws2tcpip.h>
+#endif
+
/* Specified in RFC 1939 */
#define POP3_PORT "110"
#define POP3S_PORT "995"
@@ -229,7 +234,8 @@ connect_to_server (CamelService *service,
tmp = get_valid_utf8_error ((gchar *) store->engine->line);
g_set_error (
error, CAMEL_ERROR, CAMEL_ERROR_SYSTEM,
- _("Failed to connect to POP server %s in secure mode: %s"),
+ /* Translators: Last %s is an optional explanation beginning with ": " separator */
+ _("Failed to connect to POP server %s in secure mode%s"),
service->url->host, (tmp != NULL) ? tmp : "");
g_free (tmp);
goto stls_exception;
@@ -436,7 +442,8 @@ try_sasl (CamelPOP3Store *store,
g_set_error (
error, CAMEL_SERVICE_ERROR,
CAMEL_SERVICE_ERROR_CANT_AUTHENTICATE,
- _("SASL '%s' Login failed for POP server %s: %s"),
+ /* Translators: Last %s is an optional explanation beginning with ": " separator */
+ _("SASL '%s' Login failed for POP server %s%s"),
mech, CAMEL_SERVICE (store)->url->host,
(tmp != NULL) ? tmp : "");
g_free (tmp);
@@ -595,8 +602,9 @@ pop3_try_authenticate (CamelService *service,
g_set_error (
error, CAMEL_SERVICE_ERROR,
CAMEL_SERVICE_ERROR_CANT_AUTHENTICATE,
+ /* Translators: Last %s is an optional explanation beginning with ": " separator */
_("Unable to connect to POP server %s.\n"
- "Error sending username: %s"),
+ "Error sending username%s"),
CAMEL_SERVICE (store)->url->host,
(tmp != NULL) ? tmp : "");
g_free (tmp);
@@ -607,8 +615,9 @@ pop3_try_authenticate (CamelService *service,
g_set_error (
error, CAMEL_SERVICE_ERROR,
CAMEL_SERVICE_ERROR_CANT_AUTHENTICATE,
+ /* Translators: Last %s is an optional explanation beginning with ": " separator */
_("Unable to connect to POP server %s.\n"
- "Error sending password: %s"),
+ "Error sending password%s"),
CAMEL_SERVICE (store)->url->host,
(tmp != NULL) ? tmp : "");
g_free (tmp);
diff --git a/camel/providers/smtp/camel-smtp-provider.c b/camel/providers/smtp/camel-smtp-provider.c
index 0136828..e611711 100644
--- a/camel/providers/smtp/camel-smtp-provider.c
+++ b/camel/providers/smtp/camel-smtp-provider.c
@@ -30,6 +30,11 @@
#include "camel-smtp-transport.h"
+#ifdef G_OS_WIN32
+#include <winsock2.h>
+#include <ws2tcpip.h>
+#endif
+
static guint smtp_url_hash (gconstpointer key);
static gint smtp_url_equal (gconstpointer a, gconstpointer b);
diff --git a/camel/providers/smtp/camel-smtp-transport.c b/camel/providers/smtp/camel-smtp-transport.c
index 3f807b5..cc8cdb7 100644
--- a/camel/providers/smtp/camel-smtp-transport.c
+++ b/camel/providers/smtp/camel-smtp-transport.c
@@ -40,6 +40,11 @@
#include "camel-smtp-transport.h"
+#ifdef G_OS_WIN32
+#include <winsock2.h>
+#include <ws2tcpip.h>
+#endif
+
#undef MIN
#undef MAX
@@ -681,7 +686,7 @@ smtp_send_to (CamelTransport *transport, CamelMimeMessage *message,
GError **error)
{
CamelSmtpTransport *smtp_transport = CAMEL_SMTP_TRANSPORT (transport);
- const CamelInternetAddress *cia;
+ CamelInternetAddress *cia;
gboolean has_8bit_parts;
const gchar *addr;
gint i, len;
diff --git a/camel/providers/smtp/camel-smtp-transport.h b/camel/providers/smtp/camel-smtp-transport.h
index 86b5474..faebdb2 100644
--- a/camel/providers/smtp/camel-smtp-transport.h
+++ b/camel/providers/smtp/camel-smtp-transport.h
@@ -53,6 +53,10 @@
#define CAMEL_SMTP_TRANSPORT_AUTH_EQUAL (1 << 4) /* set if we are using authtypes from a broken AUTH= */
+#ifdef G_OS_WIN32
+#define socklen_t int
+#endif
+
G_BEGIN_DECLS
typedef struct _CamelSmtpTransport CamelSmtpTransport;
@@ -80,4 +84,8 @@ GType camel_smtp_transport_get_type (void);
G_END_DECLS
+#ifdef G_OS_WIN32
+#undef socklen_t
+#endif
+
#endif /* CAMEL_SMTP_TRANSPORT_H */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]