aboutsummaryrefslogtreecommitdiffstats
path: root/mail/mail-threads.c
diff options
context:
space:
mode:
authorPeter Williams <peterw@src.gnome.org>2000-08-12 01:35:14 +0800
committerPeter Williams <peterw@src.gnome.org>2000-08-12 01:35:14 +0800
commit1fa80ef1b7e6de2c0653b68f60986ae4150d2780 (patch)
tree17909256c3f891914df8c2baec4b13198822725b /mail/mail-threads.c
parent5d79af0da616d725eebfc15d100ee62ff18cb037 (diff)
downloadgsoc2013-evolution-1fa80ef1b7e6de2c0653b68f60986ae4150d2780.tar.gz
gsoc2013-evolution-1fa80ef1b7e6de2c0653b68f60986ae4150d2780.tar.zst
gsoc2013-evolution-1fa80ef1b7e6de2c0653b68f60986ae4150d2780.zip
Fix the camel-folder's thaw handler. Implement event forwarding into the main thread.
svn path=/trunk/; revision=4744
Diffstat (limited to 'mail/mail-threads.c')
-rw-r--r--mail/mail-threads.c34
1 files changed, 34 insertions, 0 deletions
diff --git a/mail/mail-threads.c b/mail/mail-threads.c
index bdfa7b260f..7bd98a6912 100644
--- a/mail/mail-threads.c
+++ b/mail/mail-threads.c
@@ -26,6 +26,7 @@
#include <string.h>
#include <glib.h>
+#include "camel/camel-object.h"
#include "mail.h"
#include "mail-threads.h"
@@ -68,6 +69,7 @@ typedef struct com_msg_s
MESSAGE,
PASSWORD,
ERROR,
+ FORWARD_EVENT,
FINISHED
} type;
gfloat percentage;
@@ -79,6 +81,12 @@ typedef struct com_msg_s
gchar **reply;
gboolean secret;
gboolean *success;
+
+ /* Event stuff */
+ CamelObjectEventHookFunc event_hook;
+ CamelObject *event_obj;
+ gpointer event_event_data;
+ gpointer event_user_data;
}
com_msg_t;
@@ -484,6 +492,25 @@ mail_op_error (gchar * fmt, ...)
}
/**
+ * mail_op_forward_event:
+ *
+ * Communicate a camel event over to the main thread.
+ **/
+
+void
+mail_op_forward_event (CamelObjectEventHookFunc func, CamelObject *o,
+ gpointer event_data, gpointer user_data)
+{
+ com_msg_t msg;
+
+ msg.type = FORWARD_EVENT;
+ msg.event_hook = func;
+ msg.event_obj = o;
+ msg.event_event_data = event_data;
+ msg.event_user_data = user_data;
+ write (MAIN_WRITER, &msg, sizeof (msg));
+}
+/**
* mail_operation_wait_for_finish:
*
* Waits for the currently executing async operations
@@ -887,6 +914,13 @@ read_msg (GIOChannel * source, GIOCondition condition, gpointer userdata)
* call for us
*/
+ case FORWARD_EVENT:
+ DEBUG (("*** Message -- FORWARD_EVENT %p", msg->event_hook));
+
+ g_assert (msg->event_hook);
+ (msg->event_hook) (msg->event_obj, msg->event_event_data, msg->event_user_data);
+ break;
+
case FINISHED:
DEBUG (
("*** Message -- FINISH %s\n",