aboutsummaryrefslogtreecommitdiffstats
path: root/mail/mail-ops.c
diff options
context:
space:
mode:
authorMilan Crha <mcrha@redhat.com>2009-10-27 21:01:10 +0800
committerMilan Crha <mcrha@redhat.com>2009-10-27 21:01:10 +0800
commit555c178a7d52ae4aa5a52fa78bbbc0f70f4cc576 (patch)
tree938d1b7f190318d9e40b295df7c8c411da608b34 /mail/mail-ops.c
parentd00a56d4cc6f3185004f6babdb1a5f7aad729b5e (diff)
downloadgsoc2013-evolution-555c178a7d52ae4aa5a52fa78bbbc0f70f4cc576.tar
gsoc2013-evolution-555c178a7d52ae4aa5a52fa78bbbc0f70f4cc576.tar.gz
gsoc2013-evolution-555c178a7d52ae4aa5a52fa78bbbc0f70f4cc576.tar.bz2
gsoc2013-evolution-555c178a7d52ae4aa5a52fa78bbbc0f70f4cc576.tar.lz
gsoc2013-evolution-555c178a7d52ae4aa5a52fa78bbbc0f70f4cc576.tar.xz
gsoc2013-evolution-555c178a7d52ae4aa5a52fa78bbbc0f70f4cc576.tar.zst
gsoc2013-evolution-555c178a7d52ae4aa5a52fa78bbbc0f70f4cc576.zip
Bug #571039 - Shows all selected messages in a preview pane on a slow network
Diffstat (limited to 'mail/mail-ops.c')
-rw-r--r--mail/mail-ops.c23
1 files changed, 18 insertions, 5 deletions
diff --git a/mail/mail-ops.c b/mail/mail-ops.c
index 0f17dc2a4a..a251c871a9 100644
--- a/mail/mail-ops.c
+++ b/mail/mail-ops.c
@@ -1836,7 +1836,10 @@ get_message_desc (struct _get_message_msg *m)
static void
get_message_exec (struct _get_message_msg *m)
{
- m->message = camel_folder_get_message(m->folder, m->uid, &m->base.ex);
+ if (m->base.cancel && camel_operation_cancel_check (m->base.cancel))
+ m->message = NULL;
+ else
+ m->message = camel_folder_get_message (m->folder, m->uid, &m->base.ex);
}
static void
@@ -1865,12 +1868,13 @@ static MailMsgInfo get_message_info = {
(MailMsgFreeFunc) get_message_free
};
-void
+gint
mail_get_message(CamelFolder *folder, const gchar *uid, void (*done) (CamelFolder *folder, const gchar *uid,
CamelMimeMessage *msg, gpointer data),
gpointer data, MailMsgDispatchFunc dispatch)
{
struct _get_message_msg *m;
+ gint id;
m = mail_msg_new(&get_message_info);
m->folder = folder;
@@ -1879,8 +1883,11 @@ mail_get_message(CamelFolder *folder, const gchar *uid, void (*done) (CamelFolde
m->data = data;
m->done = (void (*) (CamelFolder *, const gchar *, CamelMimeMessage *, gpointer )) done;
m->cancel = camel_operation_new(NULL, NULL);
+ id = m->base.seq;
dispatch (m);
+
+ return id;
}
typedef void (*get_done)(CamelFolder *folder, const gchar *uid, CamelMimeMessage *msg, gpointer data, CamelException *);
@@ -1904,11 +1911,12 @@ static MailMsgInfo get_messagex_info = {
/* This is temporary, to avoid having to rewrite everything that uses
mail_get_message; it adds an exception argument to the callback */
-CamelOperation *
+gint
mail_get_messagex(CamelFolder *folder, const gchar *uid, void (*done) (CamelFolder *folder, const gchar *uid, CamelMimeMessage *msg, gpointer data, CamelException *),
gpointer data, MailMsgDispatchFunc dispatch)
{
struct _get_message_msg *m;
+ gint id;
m = mail_msg_new(&get_messagex_info);
m->folder = folder;
@@ -1917,10 +1925,11 @@ mail_get_messagex(CamelFolder *folder, const gchar *uid, void (*done) (CamelFold
m->data = data;
m->done = (void (*) (CamelFolder *, const gchar *, CamelMimeMessage *, gpointer )) done;
m->cancel = camel_operation_new(NULL, NULL);
+ id = m->base.seq;
dispatch (m);
- return m->cancel;
+ return id;
}
/* ********************************************************************** */
@@ -1991,12 +2000,13 @@ static MailMsgInfo get_messages_info = {
(MailMsgFreeFunc) get_messages_free
};
-void
+gint
mail_get_messages(CamelFolder *folder, GPtrArray *uids,
void (*done) (CamelFolder *folder, GPtrArray *uids, GPtrArray *msgs, gpointer data),
gpointer data)
{
struct _get_messages_msg *m;
+ gint id;
m = mail_msg_new(&get_messages_info);
m->folder = folder;
@@ -2005,8 +2015,11 @@ mail_get_messages(CamelFolder *folder, GPtrArray *uids,
m->messages = g_ptr_array_new();
m->data = data;
m->done = done;
+ id = m->base.seq;
mail_msg_unordered_push (m);
+
+ return id;
}
/* ** SAVE MESSAGES ******************************************************* */