aboutsummaryrefslogtreecommitdiffstats
path: root/mail/session.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/session.c
parent822b1964647ff9ecd3be57d1982bddfa43cba73e (diff)
downloadgsoc2013-evolution-0f2a13586b155c0e97eab0b1bc9ab59e5587555d.tar.gz
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/session.c')
-rw-r--r--mail/session.c65
1 files changed, 27 insertions, 38 deletions
diff --git a/mail/session.c b/mail/session.c
index 8e8ff6e4bf..53c694206b 100644
--- a/mail/session.c
+++ b/mail/session.c
@@ -25,7 +25,6 @@
#include <gnome.h>
#include "mail.h"
#include "mail-session.h"
-#include "mail-threads.h"
#include "mail-mt.h"
CamelSession *session;
@@ -173,63 +172,54 @@ mail_session_remember_password (const char *url)
/* ******************** */
-typedef struct _timeout_data_s {
+struct _timeout_data {
CamelTimeoutCallback cb;
gpointer camel_data;
gboolean result;
-} timeout_data_t;
-
-static gchar *
-describe_camel_timeout (gpointer in_data, gboolean gerund)
-{
- /* FIXME this is so wrong */
+};
- if (gerund)
- return g_strdup ("Keeping connection alive");
- else
- return g_strdup ("Keep connection alive");
-}
+struct _timeout_msg {
+ struct _mail_msg msg;
-static void
-noop_camel_timeout (gpointer in_data, gpointer op_data, CamelException *ex)
-{
-}
+ CamelTimeoutCallback cb;
+ gpointer camel_data;
+};
-static void
-do_camel_timeout (gpointer in_data, gpointer op_data, CamelException *ex)
+static void timeout_timeout(struct _mail_msg *mm)
{
- timeout_data_t *td = (timeout_data_t *) in_data;
+ struct _timeout_msg *m = (struct _timeout_msg *)mm;
- td->result = (td->cb) (td->camel_data);
+ /* we ignore the callback result, do we care?? no. */
+ m->cb(m->camel_data);
}
-static const mail_operation_spec spec_camel_timeout =
-{
- describe_camel_timeout,
- 0,
- noop_camel_timeout,
- do_camel_timeout,
- noop_camel_timeout
+static struct _mail_msg_op timeout_op = {
+ NULL,
+ timeout_timeout,
+ NULL,
+ NULL,
};
static gboolean
camel_timeout (gpointer data)
{
- timeout_data_t *td = (timeout_data_t *) data;
+ struct _timeout_data *td = data;
+ struct _timeout_msg *m;
- if (td->result == FALSE) {
- g_free (td);
- return FALSE;
- }
+ m = mail_msg_new(&timeout_op, NULL, sizeof(*m));
+
+ m->cb = td->cb;
+ m->camel_data = td->camel_data;
+
+ e_thread_put(mail_thread_queued, (EMsg *)m);
- mail_operation_queue (&spec_camel_timeout, td, FALSE);
return TRUE;
}
static guint
register_callback (guint32 interval, CamelTimeoutCallback cb, gpointer camel_data)
{
- timeout_data_t *td;
+ struct _timeout_data *td;
/* We do this because otherwise the timeout can get called
* more often than the dispatch thread can get rid of it,
@@ -238,13 +228,12 @@ register_callback (guint32 interval, CamelTimeoutCallback cb, gpointer camel_dat
*/
g_return_val_if_fail (interval > 1000, 0);
- td = g_new (timeout_data_t, 1);
+ td = g_malloc(sizeof(*td));
td->result = TRUE;
td->cb = cb;
td->camel_data = camel_data;
- return gtk_timeout_add_full (interval, camel_timeout, NULL,
- td, g_free);
+ return gtk_timeout_add_full(interval, camel_timeout, NULL, td, g_free);
}
static gboolean