aboutsummaryrefslogtreecommitdiffstats
path: root/mail/mail-ops.c
diff options
context:
space:
mode:
authorNot Zed <NotZed@Ximian.com>2001-01-29 17:33:15 +0800
committerMichael Zucci <zucchi@src.gnome.org>2001-01-29 17:33:15 +0800
commitaad4202594a706636bc893b8716a573861216175 (patch)
treef0e1c0efaf1b86a1408805353f3e914216aa469a /mail/mail-ops.c
parent1b18f022ca57ebebb272a148b25173d92b2b89c5 (diff)
downloadgsoc2013-evolution-aad4202594a706636bc893b8716a573861216175.tar
gsoc2013-evolution-aad4202594a706636bc893b8716a573861216175.tar.gz
gsoc2013-evolution-aad4202594a706636bc893b8716a573861216175.tar.bz2
gsoc2013-evolution-aad4202594a706636bc893b8716a573861216175.tar.lz
gsoc2013-evolution-aad4202594a706636bc893b8716a573861216175.tar.xz
gsoc2013-evolution-aad4202594a706636bc893b8716a573861216175.tar.zst
gsoc2013-evolution-aad4202594a706636bc893b8716a573861216175.zip
Debug function to compare the tree we think we have, after an incremental
2001-01-29 Not Zed <NotZed@Ximian.com> * message-list.c (tree_equal): Debug function to compare the tree we think we have, after an incremental update. (build_tree): Check the tree after we've built it. * mail-mt.c (mail_get_password): If we are being called from the main gui thread, then just call the dialogue directly. Ideally we dont want this anyway but lets handle the case nicely. (mail_get_password): Try locking around the password request, to single-queue any password requests. (mail_msg_init): Push an exit handler to clean it up on completion. * mail-send-recv.c (receive_update_got_store): New function called when the store has been retrieved asynchronously. (mail_send_receive): Get the store asynchronously. This was causing problems where the password dialogue would try and be called from the main thread via a message. * mail-ops.c (mail_get_store): New function to get a store (a)synchronously. More or less taken from subscribe-dialog, which i will remove later. (mail_scan_subfolders): Try running the scan subfolder thing asynchronously, to help startup time. Not sure if this will work, but presumably the shell can handle the folders appearing later ok. svn path=/trunk/; revision=7886
Diffstat (limited to 'mail/mail-ops.c')
-rw-r--r--mail/mail-ops.c67
1 files changed, 66 insertions, 1 deletions
diff --git a/mail/mail-ops.c b/mail/mail-ops.c
index d24c47dd85..1a78c2c7af 100644
--- a/mail/mail-ops.c
+++ b/mail/mail-ops.c
@@ -1057,7 +1057,7 @@ void mail_scan_subfolders(CamelStore *store, EvolutionStorage *storage)
int id;
id = mail_get_folderinfo(store, do_scan_subfolders, storage);
- mail_msg_wait(id);
+ /*mail_msg_wait(id);*/
}
/* ** ATTACH MESSAGES ****************************************************** */
@@ -1188,6 +1188,71 @@ mail_get_folder(const char *uri, void (*done) (char *uri, CamelFolder *folder, v
return id;
}
+/* ** GET STORE ******************************************************* */
+
+struct _get_store_msg {
+ struct _mail_msg msg;
+
+ char *uri;
+ CamelStore *store;
+ void (*done) (char *uri, CamelStore *store, void *data);
+ void *data;
+};
+
+static char *get_store_desc(struct _mail_msg *mm, int done)
+{
+ struct _get_store_msg *m = (struct _get_store_msg *)mm;
+
+ return g_strdup_printf(_("Opening store %s"), m->uri);
+}
+
+static void get_store_get(struct _mail_msg *mm)
+{
+ struct _get_store_msg *m = (struct _get_store_msg *)mm;
+
+ m->store = camel_session_get_store(session, m->uri, &mm->ex);
+}
+
+static void get_store_got(struct _mail_msg *mm)
+{
+ struct _get_store_msg *m = (struct _get_store_msg *)mm;
+
+ if (m->done)
+ m->done(m->uri, m->store, m->data);
+}
+
+static void get_store_free(struct _mail_msg *mm)
+{
+ struct _get_store_msg *m = (struct _get_store_msg *)mm;
+
+ g_free(m->uri);
+ if (m->store)
+ camel_object_unref((CamelObject *)m->store);
+}
+
+static struct _mail_msg_op get_store_op = {
+ get_store_desc,
+ get_store_get,
+ get_store_got,
+ get_store_free,
+};
+
+int
+mail_get_store(const char *uri, void (*done) (char *uri, CamelStore *store, void *data), void *data)
+{
+ struct _get_store_msg *m;
+ int id;
+
+ m = mail_msg_new(&get_store_op, NULL, sizeof(*m));
+ m->uri = g_strdup(uri);
+ m->data = data;
+ m->done = done;
+
+ id = m->msg.seq;
+ e_thread_put(mail_thread_new, (EMsg *)m);
+ return id;
+}
+
/* ** CREATE FOLDER ******************************************************* */
/* trying to find a way to remove this entirely and just use get_folder()