aboutsummaryrefslogtreecommitdiffstats
path: root/mail/mail-config.c
diff options
context:
space:
mode:
authorNot Zed <NotZed@Ximian.com>2001-02-21 10:19:26 +0800
committerMichael Zucci <zucchi@src.gnome.org>2001-02-21 10:19:26 +0800
commit0f2a13586b155c0e97eab0b1bc9ab59e5587555d (patch)
treee965c04ae4bad885df89f93ae33c74e1cbbe0f20 /mail/mail-config.c
parent822b1964647ff9ecd3be57d1982bddfa43cba73e (diff)
downloadgsoc2013-evolution-0f2a13586b155c0e97eab0b1bc9ab59e5587555d.tar
gsoc2013-evolution-0f2a13586b155c0e97eab0b1bc9ab59e5587555d.tar.gz
gsoc2013-evolution-0f2a13586b155c0e97eab0b1bc9ab59e5587555d.tar.bz2
gsoc2013-evolution-0f2a13586b155c0e97eab0b1bc9ab59e5587555d.tar.lz
gsoc2013-evolution-0f2a13586b155c0e97eab0b1bc9ab59e5587555d.tar.xz
gsoc2013-evolution-0f2a13586b155c0e97eab0b1bc9ab59e5587555d.tar.zst
gsoc2013-evolution-0f2a13586b155c0e97eab0b1bc9ab59e5587555d.zip
Fix for api changes to append_mail.
2001-02-21 Not Zed <NotZed@Ximian.com> * mail-callbacks.c (composer_postpone_cb): Fix for api changes to append_mail. * Makefile.am (evolution_mail_SOURCES): Removed mail-threads.[ch]. * mail-threads.[ch]: Removed. * subscribe-dialog.c (subscribe_do_get_store): Chagned to use new thread stuff. This is really getting boring. (subscribe_do_subscribe_folder): Changed to use new thread stuff. Last one at last, phew. * session.c (register_callback): Changed to use new thread stuff. YUCK. I dropped some functionality, now the timeout callback return is ignored, so basically it keeps running till finished. * mail-ops.c (mail_operation_run): Removed, no longer used/needed. (mail_do_append_mail): Changed to use new thread stuff. (mail_do_transfer_messages): ditto. * mail-local.c (local_storage_new_folder_cb): Use new thread stuff, also only run synchronous for this operation. (mail_local_reconfigure_folder): (reconfigure_clicked): Changed to use new mail thread stuff. * mail-config.c (mail_config_check_service): Changed to use new thread stuff. svn path=/trunk/; revision=8314
Diffstat (limited to 'mail/mail-config.c')
-rw-r--r--mail/mail-config.c80
1 files changed, 40 insertions, 40 deletions
diff --git a/mail/mail-config.c b/mail/mail-config.c
index bdf739bafe..cdb98cd0f9 100644
--- a/mail/mail-config.c
+++ b/mail/mail-config.c
@@ -33,6 +33,7 @@
#include "mail.h"
#include "mail-config.h"
#include "mail-ops.h"
+#include "mail-mt.h"
typedef struct {
gboolean thread_list;
@@ -819,53 +820,49 @@ mail_config_folder_to_cachename (CamelFolder *folder, const char *prefix)
/* Async service-checking/authtype-lookup code. */
+struct _check_msg {
+ struct _mail_msg msg;
-typedef struct {
char *url;
CamelProviderType type;
gboolean connect;
GList **authtypes;
- gboolean success;
-} check_service_input_t;
-
-static char *
-describe_check_service (gpointer in_data, gboolean gerund)
-{
- if (gerund)
- return g_strdup (_("Connecting to server"));
- else
- return g_strdup (_("Connect to server"));
-}
+ gboolean *success;
+};
-static void
-do_check_service (gpointer in_data, gpointer op_data, CamelException *ex)
+static void check_service_check(struct _mail_msg *mm)
{
- check_service_input_t *input = in_data;
+ struct _check_msg *m = (struct _check_msg *)mm;
CamelService *service = NULL;
- if (input->authtypes) {
- service = camel_session_get_service (session, input->url, input->type, ex);
+ if (m->authtypes) {
+ service = camel_session_get_service (session, m->url, m->type, &mm->ex);
if (!service)
return;
- *input->authtypes = camel_service_query_auth_types (service, input->connect, ex);
- } else if (input->connect) {
- service = camel_session_get_service_connected (session, input->url, input->type, ex);
+ *m->authtypes = camel_service_query_auth_types (service, m->connect, &mm->ex);
+ } else if (m->connect) {
+ service = camel_session_get_service_connected (session, m->url, m->type, &mm->ex);
}
if (service)
camel_object_unref (CAMEL_OBJECT (service));
- if (!camel_exception_is_set (ex))
- input->success = TRUE;
+
+ *m->success = !camel_exception_is_set(&mm->ex);
+}
+
+static void check_service_free(struct _mail_msg *mm)
+{
+ struct _check_msg *m = (struct _check_msg *)mm;
+
+ g_free(m->url);
}
-static const mail_operation_spec op_check_service = {
- describe_check_service,
- 0,
+static struct _mail_msg_op check_service_op = {
NULL,
- do_check_service,
- NULL
+ check_service_check,
+ NULL,
+ check_service_free
};
-
/**
* mail_config_check_service:
* @url: service url
@@ -886,17 +883,20 @@ static const mail_operation_spec op_check_service = {
gboolean
mail_config_check_service (CamelURL *url, CamelProviderType type, gboolean connect, GList **authtypes)
{
- check_service_input_t input;
-
- input.url = camel_url_to_string (url, TRUE);
- input.type = type;
- input.connect = connect;
- input.authtypes = authtypes;
- input.success = FALSE;
-
- mail_operation_queue (&op_check_service, &input, FALSE);
- mail_operation_wait_for_finish ();
- g_free (input.url);
+ gboolean ret = FALSE;
+ struct _check_msg *m;
+ int id;
+
+ m = mail_msg_new(&check_service_op, NULL, sizeof(*m));
+ m->url = camel_url_to_string(url, TRUE);
+ m->type = type;
+ m->connect = connect;
+ m->authtypes = authtypes;
+ m->success = &ret;
+
+ id = m->msg.seq;
+ e_thread_put(mail_thread_queued, (EMsg *)m);
+ mail_msg_wait(id);
- return input.success;
+ return ret;
}