diff --git a/evolution-2.10.0-e-passwords.patch b/evolution-2.10.0-e-passwords.patch
deleted file mode 100644
index 8489dee..0000000
--- a/evolution-2.10.0-e-passwords.patch
+++ /dev/null
@@ -1,31 +0,0 @@
---- evolution-2.10.0/mail/mail-session.c.e-passwords 2007-03-12 23:41:06.000000000 -0400
-+++ evolution-2.10.0/mail/mail-session.c 2007-03-12 23:41:35.000000000 -0400
-@@ -679,8 +679,6 @@
-
- d(printf ("Gone non-interactive, checking for outstanding interactive tasks\n"));
-
-- e_passwords_cancel();
--
- /* flush/cancel pending user messages */
- while ((um = (struct _user_message_msg *) e_dlist_remhead (&message_list))) {
- d(printf ("Flusing message request: %s\n", um->prompt));
---- evolution-2.10.0/shell/main.c.e-passwords 2007-03-12 23:39:38.000000000 -0400
-+++ evolution-2.10.0/shell/main.c 2007-03-12 23:39:54.000000000 -0400
-@@ -565,7 +565,6 @@
- glade_init ();
- e_cursors_init ();
- e_icon_factory_init ();
-- e_passwords_init();
-
- gtk_window_set_default_icon_name ("evolution");
-
---- evolution-2.10.0/calendar/gui/alarm-notify/notify-main.c.e-passwords 2007-03-12 23:40:22.000000000 -0400
-+++ evolution-2.10.0/calendar/gui/alarm-notify/notify-main.c 2007-03-12 23:40:36.000000000 -0400
-@@ -169,7 +169,6 @@
-
- alarm_done ();
-
-- e_passwords_shutdown ();
- gnome_sound_shutdown ();
-
- return 0;
diff --git a/evolution-2.21.4-too-noisy.patch b/evolution-2.21.4-too-noisy.patch
new file mode 100644
index 0000000..379e6ff
--- /dev/null
+++ b/evolution-2.21.4-too-noisy.patch
@@ -0,0 +1,12 @@
+diff -up evolution-2.21.4/plugins/mail-notification/mail-notification.c.too-noisy evolution-2.21.4/plugins/mail-notification/mail-notification.c
+--- evolution-2.21.4/plugins/mail-notification/mail-notification.c.too-noisy 2007-12-15 10:58:55.000000000 -0500
++++ evolution-2.21.4/plugins/mail-notification/mail-notification.c 2007-12-17 12:41:26.000000000 -0500
+@@ -581,7 +581,7 @@ static void
+ new_notify_sound (EMEventTargetFolder *t)
+ {
+ time_t last_newmail;
+- struct _SoundNotifyData data = {0, 0};
++ static struct _SoundNotifyData data = {0, 0};
+
+ time (&last_newmail);
+
diff --git a/evolution-2.4.1-hide-switcher-buttons-by-default.patch b/evolution-2.4.1-hide-switcher-buttons-by-default.patch
deleted file mode 100644
index f5ac169..0000000
--- a/evolution-2.4.1-hide-switcher-buttons-by-default.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- evolution-2.4.1/shell/apps_evolution_shell.schemas.in.hide-switcher-buttons-by-default 2005-10-26 16:21:15.000000000 -0400
-+++ evolution-2.4.1/shell/apps_evolution_shell.schemas.in 2005-10-26 16:21:22.000000000 -0400
-@@ -99,7 +99,7 @@
- /apps/evolution/shell/view_defaults/buttons_visible
- evolution
- bool
-- TRUE
-+ FALSE
-
- Window buttons are visible
- Whether the window buttons should be visible.
diff --git a/evolution-2.8.1-kill-ethread.patch b/evolution-2.8.1-kill-ethread.patch
index 4c9f486..72c9513 100644
--- a/evolution-2.8.1-kill-ethread.patch
+++ b/evolution-2.8.1-kill-ethread.patch
@@ -1,18 +1,18 @@
-diff -up evolution-2.21.1/mail/mail-send-recv.c.kill-ethread evolution-2.21.1/mail/mail-send-recv.c
---- evolution-2.21.1/mail/mail-send-recv.c.kill-ethread 2007-10-23 06:06:27.000000000 -0400
-+++ evolution-2.21.1/mail/mail-send-recv.c 2007-10-29 14:47:20.000000000 -0400
-@@ -775,23 +775,22 @@ receive_get_folder(CamelFilterDriver *d,
+diff -up evolution-2.21.4/mail/mail-send-recv.c.kill-ethread evolution-2.21.4/mail/mail-send-recv.c
+--- evolution-2.21.4/mail/mail-send-recv.c.kill-ethread 2007-12-16 14:30:32.000000000 -0500
++++ evolution-2.21.4/mail/mail-send-recv.c 2007-12-17 12:33:07.000000000 -0500
+@@ -779,23 +779,22 @@ receive_get_folder(CamelFilterDriver *d,
/* ********************************************************************** */
-
+
struct _refresh_folders_msg {
- struct _mail_msg msg;
+ MailMsg base;
-
+
struct _send_info *info;
GPtrArray *folders;
CamelStore *store;
};
-
+
-static char *
-refresh_folders_desc (struct _mail_msg *mm, int done)
+static gchar *
@@ -20,7 +20,7 @@ diff -up evolution-2.21.1/mail/mail-send-recv.c.kill-ethread evolution-2.21.1/ma
{
return g_strdup_printf(_("Checking for new mail"));
}
-
+
static void
-refresh_folders_get (struct _mail_msg *mm)
+refresh_folders_exec (struct _refresh_folders_msg *m)
@@ -29,9 +29,9 @@ diff -up evolution-2.21.1/mail/mail-send-recv.c.kill-ethread evolution-2.21.1/ma
int i;
CamelFolder *folder;
CamelException ex = CAMEL_EXCEPTION_INITIALISER;
-@@ -813,17 +812,14 @@ refresh_folders_get (struct _mail_msg *m
+@@ -817,17 +816,14 @@ refresh_folders_get (struct _mail_msg *m
}
-
+
static void
-refresh_folders_got (struct _mail_msg *mm)
+refresh_folders_done (struct _refresh_folders_msg *m)
@@ -40,19 +40,19 @@ diff -up evolution-2.21.1/mail/mail-send-recv.c.kill-ethread evolution-2.21.1/ma
-
receive_done("", m->info);
}
-
+
static void
-refresh_folders_free (struct _mail_msg *mm)
+refresh_folders_free (struct _refresh_folders_msg *m)
{
- struct _refresh_folders_msg *m = (struct _refresh_folders_msg *)mm;
int i;
-
+
for (i=0;ifolders->len;i++)
-@@ -832,11 +828,12 @@ refresh_folders_free (struct _mail_msg *
+@@ -836,11 +832,12 @@ refresh_folders_free (struct _mail_msg *
camel_object_unref(m->store);
}
-
+
-static struct _mail_msg_op refresh_folders_op = {
- refresh_folders_desc,
- refresh_folders_get,
@@ -65,52 +65,52 @@ diff -up evolution-2.21.1/mail/mail-send-recv.c.kill-ethread evolution-2.21.1/ma
+ (MailMsgDoneFunc) refresh_folders_done,
+ (MailMsgFreeFunc) refresh_folders_free
};
-
+
static void
-@@ -869,13 +866,13 @@ receive_update_got_folderinfo(CamelStore
-
+@@ -870,13 +867,13 @@ receive_update_got_folderinfo(CamelStore
+
get_folders(store, folders, info);
-
+
- m = mail_msg_new(&refresh_folders_op, NULL, sizeof(*m));
+ m = mail_msg_new(&refresh_folders_info);
m->store = store;
camel_object_ref(store);
m->folders = folders;
m->info = sinfo;
-
+
- e_thread_put(mail_thread_new, (EMsg *)m);
+ mail_msg_unordered_push (m);
} else {
receive_done ("", data);
}
-diff -up evolution-2.21.1/mail/mail-component.c.kill-ethread evolution-2.21.1/mail/mail-component.c
---- evolution-2.21.1/mail/mail-component.c.kill-ethread 2007-10-23 06:06:27.000000000 -0400
-+++ evolution-2.21.1/mail/mail-component.c 2007-10-29 14:47:20.000000000 -0400
-@@ -1000,7 +1000,7 @@ impl_handleURI (PortableServer_Servant s
+diff -up evolution-2.21.4/mail/mail-component.c.kill-ethread evolution-2.21.4/mail/mail-component.c
+--- evolution-2.21.4/mail/mail-component.c.kill-ethread 2007-12-16 15:05:36.000000000 -0500
++++ evolution-2.21.4/mail/mail-component.c 2007-12-17 12:33:08.000000000 -0500
+@@ -1010,7 +1010,7 @@ impl_handleURI (PortableServer_Servant s
if (camel_url_get_param(url, "uid") != NULL) {
char *curi = em_uri_to_camel(uri);
-
+
- mail_get_folder(curi, 0, handleuri_got_folder, url, mail_thread_new);
+ mail_get_folder(curi, 0, handleuri_got_folder, url, mail_msg_unordered_push);
g_free(curi);
} else {
g_warning("email uri's must include a uid parameter");
-diff -up evolution-2.21.1/mail/mail-ops.c.kill-ethread evolution-2.21.1/mail/mail-ops.c
---- evolution-2.21.1/mail/mail-ops.c.kill-ethread 2007-10-23 06:06:27.000000000 -0400
-+++ evolution-2.21.1/mail/mail-ops.c 2007-10-29 14:54:45.000000000 -0400
+diff -up evolution-2.21.4/mail/mail-ops.c.kill-ethread evolution-2.21.4/mail/mail-ops.c
+--- evolution-2.21.4/mail/mail-ops.c.kill-ethread 2007-12-16 14:36:47.000000000 -0500
++++ evolution-2.21.4/mail/mail-ops.c 2007-12-17 12:33:07.000000000 -0500
@@ -75,7 +75,7 @@
/* used for both just filtering a folder + uid's, and for filtering a whole folder */
/* used both for fetching mail, and for filtering mail */
struct _filter_mail_msg {
- struct _mail_msg msg;
+ MailMsg base;
-
+
CamelFolder *source_folder; /* where they come from */
GPtrArray *source_uids; /* uids to copy, or NULL == copy all */
@@ -99,8 +99,8 @@ struct _fetch_mail_msg {
void *data;
};
-
+
-static char *
-em_filter_folder_element_describe (struct _mail_msg *mm, int complete)
+static gchar *
@@ -128,35 +128,35 @@ diff -up evolution-2.21.1/mail/mail-ops.c.kill-ethread evolution-2.21.1/mail/mai
- struct _filter_mail_msg *m = (struct _filter_mail_msg *)mm;
CamelFolder *folder;
GPtrArray *uids, *folder_uids = NULL;
-
-@@ -137,15 +136,15 @@ em_filter_folder_element_filter (struct
+
+@@ -137,15 +136,15 @@ em_filter_folder_element_filter (struct
else
folder_uids = uids = camel_folder_get_uids (folder);
-
+
- camel_filter_driver_filter_folder (m->driver, folder, m->cache, uids, m->delete, &mm->ex);
- camel_filter_driver_flush (m->driver, &mm->ex);
+ camel_filter_driver_filter_folder (m->driver, folder, m->cache, uids, m->delete, &m->base.ex);
+ camel_filter_driver_flush (m->driver, &m->base.ex);
-
+
if (folder_uids)
camel_folder_free_uids (folder, folder_uids);
-
+
/* sync our source folder */
if (!m->cache)
- camel_folder_sync (folder, FALSE, camel_exception_is_set (&mm->ex) ? NULL : &mm->ex);
+ camel_folder_sync (folder, FALSE, camel_exception_is_set (&m->base.ex) ? NULL : &m->base.ex);
camel_folder_thaw (folder);
-
+
if (m->destination)
-@@ -161,15 +160,13 @@ em_filter_folder_element_filter (struct
+@@ -161,15 +160,13 @@ em_filter_folder_element_filter (struct
}
-
+
static void
-em_filter_folder_element_filtered (struct _mail_msg *mm)
+em_filter_folder_element_done (struct _filter_mail_msg *m)
{
}
-
+
static void
-em_filter_folder_element_free (struct _mail_msg *mm)
+em_filter_folder_element_free (struct _filter_mail_msg *m)
@@ -165,11 +165,11 @@ diff -up evolution-2.21.1/mail/mail-ops.c.kill-ethread evolution-2.21.1/mail/mai
-
if (m->source_folder)
camel_object_unref (m->source_folder);
-
+
@@ -188,11 +185,12 @@ em_filter_folder_element_free (struct _m
mail_session_flush_filter_log ();
}
-
+
-static struct _mail_msg_op em_filter_folder_element_op = {
- em_filter_folder_element_describe, /* we do our own progress reporting? */
- em_filter_folder_element_filter,
@@ -182,12 +182,12 @@ diff -up evolution-2.21.1/mail/mail-ops.c.kill-ethread evolution-2.21.1/mail/mai
+ (MailMsgDoneFunc) em_filter_folder_element_done,
+ (MailMsgFreeFunc) em_filter_folder_element_free
};
-
+
void
@@ -202,7 +200,7 @@ mail_filter_folder (CamelFolder *source_
{
struct _filter_mail_msg *m;
-
+
- m = mail_msg_new (&em_filter_folder_element_op, NULL, sizeof (*m));
+ m = mail_msg_new (&em_filter_folder_element_info);
m->source_folder = source_folder;
@@ -196,16 +196,16 @@ diff -up evolution-2.21.1/mail/mail-ops.c.kill-ethread evolution-2.21.1/mail/mai
@@ -221,7 +219,7 @@ mail_filter_folder (CamelFolder *source_
camel_filter_driver_remove_rule_by_name (m->driver, "new-mail-notification");
}
-
+
- e_thread_put (mail_thread_new, (EMsg *)m);
+ mail_msg_unordered_push (m);
}
-
+
/* convenience functions for it */
@@ -260,17 +258,16 @@ uid_cachename_hack (CamelStore *store)
return filename;
}
-
+
-static char *
-fetch_mail_describe (struct _mail_msg *mm, int complete)
+static gchar *
@@ -213,7 +213,7 @@ diff -up evolution-2.21.1/mail/mail-ops.c.kill-ethread evolution-2.21.1/mail/mai
{
return g_strdup (_("Fetching Mail"));
}
-
+
static void
-fetch_mail_fetch (struct _mail_msg *mm)
+fetch_mail_exec (struct _fetch_mail_msg *m)
@@ -222,7 +222,7 @@ diff -up evolution-2.21.1/mail/mail-ops.c.kill-ethread evolution-2.21.1/mail/mai
- struct _filter_mail_msg *fm = (struct _filter_mail_msg *)mm;
+ struct _filter_mail_msg *fm = (struct _filter_mail_msg *)m;
int i;
-
+
if (m->cancel)
@@ -283,20 +280,20 @@ fetch_mail_fetch (struct _mail_msg *mm)
/* FIXME: this should support keep_on_server too, which would then perform a spool
@@ -230,7 +230,7 @@ diff -up evolution-2.21.1/mail/mail-ops.c.kill-ethread evolution-2.21.1/mail/mai
if (!strncmp (m->source_uri, "mbox:", 5)) {
- char *path = mail_tool_do_movemail (m->source_uri, &mm->ex);
+ char *path = mail_tool_do_movemail (m->source_uri, &fm->base.ex);
-
+
- if (path && !camel_exception_is_set (&mm->ex)) {
+ if (path && !camel_exception_is_set (&fm->base.ex)) {
camel_folder_freeze (fm->destination);
@@ -238,7 +238,7 @@ diff -up evolution-2.21.1/mail/mail-ops.c.kill-ethread evolution-2.21.1/mail/mai
- camel_filter_driver_filter_mbox (fm->driver, path, m->source_uri, &mm->ex);
+ camel_filter_driver_filter_mbox (fm->driver, path, m->source_uri, &fm->base.ex);
camel_folder_thaw (fm->destination);
-
+
- if (!camel_exception_is_set (&mm->ex))
+ if (!camel_exception_is_set (&fm->base.ex))
g_unlink (path);
@@ -247,25 +247,25 @@ diff -up evolution-2.21.1/mail/mail-ops.c.kill-ethread evolution-2.21.1/mail/mai
} else {
- CamelFolder *folder = fm->source_folder = mail_tool_get_inbox (m->source_uri, &mm->ex);
+ CamelFolder *folder = fm->source_folder = mail_tool_get_inbox (m->source_uri, &fm->base.ex);
-
+
if (folder) {
/* this handles 'keep on server' stuff, if we have any new uid's to copy
@@ -322,17 +319,17 @@ fetch_mail_fetch (struct _mail_msg *mm)
camel_uid_cache_free_uids (cache_uids);
-
+
fm->cache = cache;
- em_filter_folder_element_filter (mm);
+ em_filter_folder_element_exec (fm);
-
+
/* need to uncancel so writes/etc. don't fail */
- if (mm->ex.id == CAMEL_EXCEPTION_USER_CANCEL)
+ if (fm->base.ex.id == CAMEL_EXCEPTION_USER_CANCEL)
camel_operation_uncancel(NULL);
-
+
/* save the cache of uids that we've just downloaded */
camel_uid_cache_save (cache);
}
-
+
- if (fm->delete && mm->ex.id == CAMEL_EXCEPTION_NONE) {
+ if (fm->delete && fm->base.ex.id == CAMEL_EXCEPTION_NONE) {
/* not keep on server - just delete all the actual messages on the server */
@@ -278,11 +278,11 @@ diff -up evolution-2.21.1/mail/mail-ops.c.kill-ethread evolution-2.21.1/mail/mai
- em_filter_folder_element_filter (mm);
+ em_filter_folder_element_exec (fm);
}
-
+
/* we unref the source folder here since we
@@ -372,31 +369,28 @@ fail:
}
-
+
static void
-fetch_mail_fetched (struct _mail_msg *mm)
+fetch_mail_done (struct _fetch_mail_msg *m)
@@ -292,7 +292,7 @@ diff -up evolution-2.21.1/mail/mail-ops.c.kill-ethread evolution-2.21.1/mail/mai
if (m->done)
m->done (m->source_uri, m->data);
}
-
+
static void
-fetch_mail_free (struct _mail_msg *mm)
+fetch_mail_free (struct _fetch_mail_msg *m)
@@ -302,11 +302,11 @@ diff -up evolution-2.21.1/mail/mail-ops.c.kill-ethread evolution-2.21.1/mail/mai
g_free (m->source_uri);
if (m->cancel)
camel_operation_unref (m->cancel);
-
+
- em_filter_folder_element_free (mm);
+ em_filter_folder_element_free ((struct _filter_mail_msg *) m);
}
-
+
-static struct _mail_msg_op fetch_mail_op = {
- fetch_mail_describe, /* we do our own progress reporting */
- fetch_mail_fetch,
@@ -319,12 +319,12 @@ diff -up evolution-2.21.1/mail/mail-ops.c.kill-ethread evolution-2.21.1/mail/mai
+ (MailMsgDoneFunc) fetch_mail_done,
+ (MailMsgFreeFunc) fetch_mail_free
};
-
+
/* ouch, a 'do everything' interface ... */
@@ -409,7 +403,7 @@ mail_fetch_mail (const char *source, int
struct _fetch_mail_msg *m;
struct _filter_mail_msg *fm;
-
+
- m = mail_msg_new (&fetch_mail_op, NULL, sizeof (*m));
+ m = mail_msg_new (&fetch_mail_info);
fm = (struct _filter_mail_msg *)m;
@@ -333,24 +333,24 @@ diff -up evolution-2.21.1/mail/mail-ops.c.kill-ethread evolution-2.21.1/mail/mai
@@ -426,7 +420,7 @@ mail_fetch_mail (const char *source, int
if (status)
camel_filter_driver_set_status_func (fm->driver, status, status_data);
-
+
- e_thread_put (mail_thread_new, (EMsg *)m);
+ mail_msg_unordered_push (m);
}
-
+
/* ********************************************************************** */
@@ -657,7 +651,7 @@ exit:
/* ** SEND MAIL QUEUE ***************************************************** */
-
+
struct _send_queue_msg {
- struct _mail_msg msg;
+ MailMsg base;
-
+
CamelFolder *queue;
char *destination;
@@ -689,9 +683,8 @@ report_status (struct _send_queue_msg *m
}
-
+
static void
-send_queue_send(struct _mail_msg *mm)
+send_queue_exec (struct _send_queue_msg *m)
@@ -359,7 +359,16 @@ diff -up evolution-2.21.1/mail/mail-ops.c.kill-ethread evolution-2.21.1/mail/mai
CamelFolder *sent_folder = mail_component_get_folder(NULL, MAIL_COMPONENT_FOLDER_SENT);
GPtrArray *uids, *send_uids = NULL;
CamelException ex;
-@@ -739,17 +732,17 @@ send_queue_send(struct _mail_msg *mm)
+@@ -725,7 +718,7 @@ send_queue_send(struct _mail_msg *mm)
+ if (m->cancel)
+ camel_operation_register (m->cancel);
+ else
+- camel_operation_register (mm->cancel);
++ camel_operation_register (m->base.cancel);
+
+ if (!m->cancel)
+ camel_operation_start (NULL, _("Sending message"));
+@@ -746,17 +739,17 @@ send_queue_send(struct _mail_msg *mm)
if (camel_exception_is_set (&ex)) {
if (ex.id != CAMEL_EXCEPTION_USER_CANCEL) {
/* merge exceptions into one */
@@ -371,7 +380,7 @@ diff -up evolution-2.21.1/mail/mail-ops.c.kill-ethread evolution-2.21.1/mail/mai
- camel_exception_xfer (&mm->ex, &ex);
+ camel_exception_xfer (&m->base.ex, &ex);
camel_exception_clear (&ex);
-
+
/* keep track of the number of failures */
j++;
} else {
@@ -381,8 +390,8 @@ diff -up evolution-2.21.1/mail/mail-ops.c.kill-ethread evolution-2.21.1/mail/mai
break;
}
}
-@@ -759,7 +752,7 @@ send_queue_send(struct _mail_msg *mm)
-
+@@ -766,7 +759,7 @@ send_queue_send(struct _mail_msg *mm)
+
if (j > 0)
report_status (m, CAMEL_FILTER_STATUS_END, 100, _("Failed to send %d of %d messages"), j, send_uids->len);
- else if (mm->ex.id == CAMEL_EXCEPTION_USER_CANCEL)
@@ -390,9 +399,15 @@ diff -up evolution-2.21.1/mail/mail-ops.c.kill-ethread evolution-2.21.1/mail/mai
report_status (m, CAMEL_FILTER_STATUS_END, 100, _("Canceled."));
else
report_status (m, CAMEL_FILTER_STATUS_END, 100, _("Complete."));
-@@ -785,19 +778,15 @@ send_queue_send(struct _mail_msg *mm)
+@@ -793,24 +786,20 @@ send_queue_send(struct _mail_msg *mm)
+ if (m->cancel)
+ camel_operation_unregister (m->cancel);
+ else
+- camel_operation_unregister (mm->cancel);
++ camel_operation_unregister (m->base.cancel);
+
}
-
+
static void
-send_queue_sent(struct _mail_msg *mm)
+send_queue_done (struct _send_queue_msg *m)
@@ -402,7 +417,7 @@ diff -up evolution-2.21.1/mail/mail-ops.c.kill-ethread evolution-2.21.1/mail/mai
if (m->done)
m->done(m->destination, m->data);
}
-
+
static void
-send_queue_free(struct _mail_msg *mm)
+send_queue_free (struct _send_queue_msg *m)
@@ -412,10 +427,10 @@ diff -up evolution-2.21.1/mail/mail-ops.c.kill-ethread evolution-2.21.1/mail/mai
if (m->driver)
camel_object_unref(m->driver);
camel_object_unref(m->queue);
-@@ -806,11 +795,12 @@ send_queue_free(struct _mail_msg *mm)
+@@ -819,11 +808,12 @@ send_queue_free(struct _mail_msg *mm)
camel_operation_unref(m->cancel);
}
-
+
-static struct _mail_msg_op send_queue_op = {
- NULL, /* do our own reporting, as with fetch mail */
- send_queue_send,
@@ -428,37 +443,50 @@ diff -up evolution-2.21.1/mail/mail-ops.c.kill-ethread evolution-2.21.1/mail/mai
+ (MailMsgDoneFunc) send_queue_done,
+ (MailMsgFreeFunc) send_queue_free
};
-
+
/* same interface as fetch_mail, just 'cause i'm lazy today (and we need to run it from the same spot?) */
-@@ -823,7 +813,7 @@ mail_send_queue(CamelFolder *queue, cons
+@@ -836,17 +826,17 @@ mail_send_queue(CamelFolder *queue, cons
{
struct _send_queue_msg *m;
-
+
- m = mail_msg_new(&send_queue_op, NULL, sizeof(*m));
+ m = mail_msg_new(&send_queue_info);
m->queue = queue;
camel_object_ref(queue);
m->destination = g_strdup(destination);
-@@ -839,13 +829,13 @@ mail_send_queue(CamelFolder *queue, cons
+ if (cancel) {
+ m->cancel = cancel;
+ camel_operation_ref(cancel);
+- camel_operation_unref (((struct _mail_msg *) m)->cancel);
+- mail_msg_set_cancelable ((struct _mail_msg *)m, FALSE);
++ camel_operation_unref (m->base.cancel);
++ mail_msg_set_cancelable (m, FALSE);
+
+- ((struct _mail_msg *) m)->cancel = NULL;
++ m->base.cancel = NULL;
+ }
+ m->status = status;
+ m->status_data = status_data;
+@@ -856,13 +846,13 @@ mail_send_queue(CamelFolder *queue, cons
m->driver = camel_session_get_filter_driver (session, type, NULL);
camel_filter_driver_set_folder_func (m->driver, get_folder, get_data);
-
+
- e_thread_put(mail_thread_new, (EMsg *)m);
+ mail_msg_unordered_push (m);
}
-
+
/* ** APPEND MESSAGE TO FOLDER ******************************************** */
-
+
struct _append_msg {
- struct _mail_msg msg;
+ MailMsg base;
-
+
CamelFolder *folder;
CamelMimeMessage *message;
-@@ -856,45 +846,40 @@ struct _append_msg {
+@@ -873,45 +863,40 @@ struct _append_msg {
void *data;
};
-
+
-static char *
-append_mail_desc (struct _mail_msg *mm, int done)
+static gchar *
@@ -466,7 +494,7 @@ diff -up evolution-2.21.1/mail/mail-ops.c.kill-ethread evolution-2.21.1/mail/mai
{
return g_strdup (_("Saving message to folder"));
}
-
+
static void
-append_mail_append (struct _mail_msg *mm)
+append_mail_exec (struct _append_msg *m)
@@ -477,7 +505,7 @@ diff -up evolution-2.21.1/mail/mail-ops.c.kill-ethread evolution-2.21.1/mail/mai
- camel_folder_append_message(m->folder, m->message, m->info, &m->appended_uid, &mm->ex);
+ camel_folder_append_message(m->folder, m->message, m->info, &m->appended_uid, &m->base.ex);
}
-
+
static void
-append_mail_appended (struct _mail_msg *mm)
+append_mail_done (struct _append_msg *m)
@@ -488,7 +516,7 @@ diff -up evolution-2.21.1/mail/mail-ops.c.kill-ethread evolution-2.21.1/mail/mai
- m->done(m->folder, m->message, m->info, !camel_exception_is_set(&mm->ex), m->appended_uid, m->data);
+ m->done(m->folder, m->message, m->info, !camel_exception_is_set(&m->base.ex), m->appended_uid, m->data);
}
-
+
static void
-append_mail_free (struct _mail_msg *mm)
+append_mail_free (struct _append_msg *m)
@@ -499,7 +527,7 @@ diff -up evolution-2.21.1/mail/mail-ops.c.kill-ethread evolution-2.21.1/mail/mai
camel_object_unref(m->folder);
g_free (m->appended_uid);
}
-
+
-static struct _mail_msg_op append_mail_op = {
- append_mail_desc,
- append_mail_append,
@@ -512,37 +540,37 @@ diff -up evolution-2.21.1/mail/mail-ops.c.kill-ethread evolution-2.21.1/mail/mai
+ (MailMsgDoneFunc) append_mail_done,
+ (MailMsgFreeFunc) append_mail_free
};
-
+
void
-@@ -911,7 +896,7 @@ mail_append_mail (CamelFolder *folder, C
+@@ -928,7 +913,7 @@ mail_append_mail (CamelFolder *folder, C
camel_medium_set_header (CAMEL_MEDIUM (message), "X-Mailer",
"Evolution " VERSION SUB_VERSION " " VERSION_COMMENT);
-
+
- m = mail_msg_new (&append_mail_op, NULL, sizeof (*m));
+ m = mail_msg_new (&append_mail_info);
m->folder = folder;
camel_object_ref(folder);
m->message = message;
-@@ -921,13 +906,13 @@ mail_append_mail (CamelFolder *folder, C
+@@ -938,13 +923,13 @@ mail_append_mail (CamelFolder *folder, C
m->done = done;
m->data = data;
-
+
- e_thread_put (mail_thread_new, (EMsg *)m);
+ mail_msg_unordered_push (m);
}
-
+
/* ** TRANSFER MESSAGES **************************************************** */
-
+
struct _transfer_msg {
- struct _mail_msg msg;
+ MailMsg base;
-
+
CamelFolder *source;
GPtrArray *uids;
-@@ -939,24 +924,21 @@ struct _transfer_msg {
+@@ -956,24 +941,21 @@ struct _transfer_msg {
void *data;
};
-
+
-static char *
-transfer_messages_desc (struct _mail_msg *mm, int done)
+static gchar *
@@ -552,35 +580,35 @@ diff -up evolution-2.21.1/mail/mail-ops.c.kill-ethread evolution-2.21.1/mail/mai
-
return g_strdup_printf(m->delete?_("Moving messages to %s"):_("Copying messages to %s"),
m->dest_uri);
-
+
}
-
+
static void
-transfer_messages_transfer (struct _mail_msg *mm)
+transfer_messages_exec (struct _transfer_msg *m)
{
- struct _transfer_msg *m = (struct _transfer_msg *)mm;
CamelFolder *dest;
-
+
- dest = mail_tool_uri_to_folder (m->dest_uri, m->dest_flags, &mm->ex);
- if (camel_exception_is_set (&mm->ex))
+ dest = mail_tool_uri_to_folder (m->dest_uri, m->dest_flags, &m->base.ex);
+ if (camel_exception_is_set (&m->base.ex))
return;
-
+
if (dest == m->source) {
-@@ -968,7 +950,7 @@ transfer_messages_transfer (struct _mail
+@@ -985,7 +967,7 @@ transfer_messages_transfer (struct _mail
camel_folder_freeze (m->source);
camel_folder_freeze (dest);
-
+
- camel_folder_transfer_messages_to (m->source, m->uids, dest, NULL, m->delete, &mm->ex);
+ camel_folder_transfer_messages_to (m->source, m->uids, dest, NULL, m->delete, &m->base.ex);
-
+
/* make sure all deleted messages are marked as seen */
-
-@@ -987,29 +969,26 @@ transfer_messages_transfer (struct _mail
+
+@@ -1004,29 +986,26 @@ transfer_messages_transfer (struct _mail
}
-
+
static void
-transfer_messages_transferred (struct _mail_msg *mm)
+transfer_messages_done (struct _transfer_msg *m)
@@ -591,7 +619,7 @@ diff -up evolution-2.21.1/mail/mail-ops.c.kill-ethread evolution-2.21.1/mail/mai
- m->done (!camel_exception_is_set (&mm->ex), m->data);
+ m->done (!camel_exception_is_set (&m->base.ex), m->data);
}
-
+
static void
-transfer_messages_free (struct _mail_msg *mm)
+transfer_messages_free (struct _transfer_msg *m)
@@ -602,7 +630,7 @@ diff -up evolution-2.21.1/mail/mail-ops.c.kill-ethread evolution-2.21.1/mail/mai
g_free (m->dest_uri);
em_utils_uids_free (m->uids);
}
-
+
-static struct _mail_msg_op transfer_messages_op = {
- transfer_messages_desc,
- transfer_messages_transfer,
@@ -615,37 +643,37 @@ diff -up evolution-2.21.1/mail/mail-ops.c.kill-ethread evolution-2.21.1/mail/mai
+ (MailMsgDoneFunc) transfer_messages_done,
+ (MailMsgFreeFunc) transfer_messages_free
};
-
+
void
-@@ -1026,7 +1005,7 @@ mail_transfer_messages (CamelFolder *sou
+@@ -1043,7 +1022,7 @@ mail_transfer_messages (CamelFolder *sou
g_return_if_fail (uids != NULL);
g_return_if_fail (dest_uri != NULL);
-
+
- m = mail_msg_new(&transfer_messages_op, NULL, sizeof(*m));
+ m = mail_msg_new(&transfer_messages_info);
m->source = source;
camel_object_ref (source);
m->uids = uids;
-@@ -1036,13 +1015,13 @@ mail_transfer_messages (CamelFolder *sou
+@@ -1053,13 +1032,13 @@ mail_transfer_messages (CamelFolder *sou
m->done = done;
m->data = data;
-
+
- e_thread_put(mail_thread_queued_slow, (EMsg *)m);
+ mail_msg_slow_ordered_push (m);
}
-
+
/* ** SCAN SUBFOLDERS ***************************************************** */
-
+
struct _get_folderinfo_msg {
- struct _mail_msg msg;
+ MailMsg base;
-
+
CamelStore *store;
CamelFolderInfo *info;
-@@ -1050,10 +1029,9 @@ struct _get_folderinfo_msg {
+@@ -1067,10 +1046,9 @@ struct _get_folderinfo_msg {
void *data;
};
-
+
-static char *
-get_folderinfo_desc (struct _mail_msg *mm, int done)
+static gchar *
@@ -653,22 +681,22 @@ diff -up evolution-2.21.1/mail/mail-ops.c.kill-ethread evolution-2.21.1/mail/mai
{
- struct _get_folderinfo_msg *m = (struct _get_folderinfo_msg *)mm;
char *ret, *name;
-
+
name = camel_service_get_name((CamelService *)m->store, TRUE);
-@@ -1063,25 +1041,22 @@ get_folderinfo_desc (struct _mail_msg *m
+@@ -1080,25 +1058,22 @@ get_folderinfo_desc (struct _mail_msg *m
}
-
+
static void
-get_folderinfo_get (struct _mail_msg *mm)
+get_folderinfo_exec (struct _get_folderinfo_msg *m)
{
- struct _get_folderinfo_msg *m = (struct _get_folderinfo_msg *)mm;
guint32 flags = CAMEL_STORE_FOLDER_INFO_RECURSIVE|CAMEL_STORE_FOLDER_INFO_FAST | CAMEL_STORE_FOLDER_INFO_SUBSCRIBED;
-
+
- m->info = camel_store_get_folder_info (m->store, NULL, flags, &mm->ex);
+ m->info = camel_store_get_folder_info (m->store, NULL, flags, &m->base.ex);
}
-
+
static void
-get_folderinfo_got (struct _mail_msg *mm)
+get_folderinfo_done (struct _get_folderinfo_msg *m)
@@ -678,17 +706,17 @@ diff -up evolution-2.21.1/mail/mail-ops.c.kill-ethread evolution-2.21.1/mail/mai
- if (!m->info && camel_exception_is_set (&mm->ex)) {
+ if (!m->info && camel_exception_is_set (&m->base.ex)) {
char *url;
-
+
url = camel_service_get_url (CAMEL_SERVICE (m->store));
w(g_warning ("Error getting folder info from store at %s: %s",
- url, camel_exception_get_description (&mm->ex)));
+ url, camel_exception_get_description (&m->base.ex)));
g_free (url);
}
-
-@@ -1090,20 +1065,19 @@ get_folderinfo_got (struct _mail_msg *mm
+
+@@ -1107,20 +1082,19 @@ get_folderinfo_got (struct _mail_msg *mm
}
-
+
static void
-get_folderinfo_free (struct _mail_msg *mm)
+get_folderinfo_free (struct _get_folderinfo_msg *m)
@@ -699,7 +727,7 @@ diff -up evolution-2.21.1/mail/mail-ops.c.kill-ethread evolution-2.21.1/mail/mai
camel_store_free_folder_info(m->store, m->info);
camel_object_unref(m->store);
}
-
+
-static struct _mail_msg_op get_folderinfo_op = {
- get_folderinfo_desc,
- get_folderinfo_get,
@@ -712,12 +740,12 @@ diff -up evolution-2.21.1/mail/mail-ops.c.kill-ethread evolution-2.21.1/mail/mai
+ (MailMsgDoneFunc) get_folderinfo_done,
+ (MailMsgFreeFunc) get_folderinfo_free
};
-
+
int
-@@ -1112,19 +1086,19 @@ mail_get_folderinfo (CamelStore *store,
+@@ -1129,19 +1103,19 @@ mail_get_folderinfo (CamelStore *store,
struct _get_folderinfo_msg *m;
int id;
-
+
- m = mail_msg_new(&get_folderinfo_op, NULL, sizeof(*m));
+ m = mail_msg_new(&get_folderinfo_info);
if (op) {
@@ -733,25 +761,25 @@ diff -up evolution-2.21.1/mail/mail-ops.c.kill-ethread evolution-2.21.1/mail/mai
m->data = data;
- id = m->msg.seq;
+ id = m->base.seq;
-
+
- e_thread_put(mail_thread_new, (EMsg *)m);
+ mail_msg_unordered_push (m);
-
+
return id;
}
-@@ -1196,7 +1170,7 @@ mail_build_attachment(CamelFolder *folde
+@@ -1213,7 +1187,7 @@ mail_build_attachment(CamelFolder *folde
presumably create a folder ... */
-
+
struct _get_folder_msg {
- struct _mail_msg msg;
+ MailMsg base;
-
+
char *uri;
guint32 flags;
-@@ -1205,71 +1179,64 @@ struct _get_folder_msg {
+@@ -1222,71 +1196,64 @@ struct _get_folder_msg {
void *data;
};
-
+
-static char *
-get_folder_desc (struct _mail_msg *mm, int done)
+static gchar *
@@ -761,7 +789,7 @@ diff -up evolution-2.21.1/mail/mail-ops.c.kill-ethread evolution-2.21.1/mail/mai
-
return g_strdup_printf(_("Opening folder %s"), m->uri);
}
-
+
static void
-get_folder_get (struct _mail_msg *mm)
+get_folder_exec (struct _get_folder_msg *m)
@@ -771,7 +799,7 @@ diff -up evolution-2.21.1/mail/mail-ops.c.kill-ethread evolution-2.21.1/mail/mai
- m->folder = mail_tool_uri_to_folder (m->uri, m->flags, &mm->ex);
+ m->folder = mail_tool_uri_to_folder (m->uri, m->flags, &m->base.ex);
}
-
+
static void
-get_folder_got (struct _mail_msg *mm)
+get_folder_done (struct _get_folder_msg *m)
@@ -781,7 +809,7 @@ diff -up evolution-2.21.1/mail/mail-ops.c.kill-ethread evolution-2.21.1/mail/mai
if (m->done)
m->done (m->uri, m->folder, m->data);
}
-
+
static void
-get_folder_free (struct _mail_msg *mm)
+get_folder_free (struct _get_folder_msg *m)
@@ -792,7 +820,7 @@ diff -up evolution-2.21.1/mail/mail-ops.c.kill-ethread evolution-2.21.1/mail/mai
if (m->folder)
camel_object_unref (m->folder);
}
-
+
-static struct _mail_msg_op get_folder_op = {
- get_folder_desc,
- get_folder_get,
@@ -805,7 +833,7 @@ diff -up evolution-2.21.1/mail/mail-ops.c.kill-ethread evolution-2.21.1/mail/mai
+ (MailMsgDoneFunc) get_folder_done,
+ (MailMsgFreeFunc) get_folder_free
};
-
+
int
mail_get_folder (const char *uri, guint32 flags,
void (*done)(char *uri, CamelFolder *folder, void *data),
@@ -814,33 +842,33 @@ diff -up evolution-2.21.1/mail/mail-ops.c.kill-ethread evolution-2.21.1/mail/mai
{
struct _get_folder_msg *m;
int id;
-
+
- m = mail_msg_new(&get_folder_op, NULL, sizeof(*m));
+ m = mail_msg_new(&get_folder_info);
m->uri = g_strdup (uri);
m->flags = flags;
m->data = data;
m->done = done;
-
+
- id = m->msg.seq;
- e_thread_put(thread, (EMsg *)m);
+ id = m->base.seq;
+ dispatch (m);
return id;
}
-
+
/* ** GET STORE ******************************************************* */
-
+
struct _get_store_msg {
- struct _mail_msg msg;
+ MailMsg base;
-
+
char *uri;
CamelStore *store;
-@@ -1277,50 +1244,43 @@ struct _get_store_msg {
+@@ -1294,50 +1261,43 @@ struct _get_store_msg {
void *data;
};
-
+
-static char *
-get_store_desc (struct _mail_msg *mm, int done)
+static gchar *
@@ -850,7 +878,7 @@ diff -up evolution-2.21.1/mail/mail-ops.c.kill-ethread evolution-2.21.1/mail/mai
-
return g_strdup_printf(_("Opening store %s"), m->uri);
}
-
+
static void
-get_store_get (struct _mail_msg *mm)
+get_store_exec (struct _get_store_msg *m)
@@ -858,13 +886,13 @@ diff -up evolution-2.21.1/mail/mail-ops.c.kill-ethread evolution-2.21.1/mail/mai
- struct _get_store_msg *m = (struct _get_store_msg *)mm;
-
/*camel_session_get_store connects us, which we don't want to do on startup. */
-
+
m->store = (CamelStore *) camel_session_get_service (session, m->uri,
CAMEL_PROVIDER_STORE,
- &mm->ex);
+ &m->base.ex);
}
-
+
static void
-get_store_got (struct _mail_msg *mm)
+get_store_done (struct _get_store_msg *m)
@@ -874,7 +902,7 @@ diff -up evolution-2.21.1/mail/mail-ops.c.kill-ethread evolution-2.21.1/mail/mai
if (m->done)
m->done (m->uri, m->store, m->data);
}
-
+
static void
-get_store_free (struct _mail_msg *mm)
+get_store_free (struct _get_store_msg *m)
@@ -885,7 +913,7 @@ diff -up evolution-2.21.1/mail/mail-ops.c.kill-ethread evolution-2.21.1/mail/mai
if (m->store)
camel_object_unref (m->store);
}
-
+
-static struct _mail_msg_op get_store_op = {
- get_store_desc,
- get_store_get,
@@ -898,12 +926,12 @@ diff -up evolution-2.21.1/mail/mail-ops.c.kill-ethread evolution-2.21.1/mail/mai
+ (MailMsgDoneFunc) get_store_done,
+ (MailMsgFreeFunc) get_store_free
};
-
+
int
-@@ -1329,25 +1289,25 @@ mail_get_store (const char *uri, CamelOp
+@@ -1346,25 +1306,25 @@ mail_get_store (const char *uri, CamelOp
struct _get_store_msg *m;
int id;
-
+
- m = mail_msg_new (&get_store_op, NULL, sizeof (*m));
+ m = mail_msg_new (&get_store_info);
if (op) {
@@ -916,26 +944,26 @@ diff -up evolution-2.21.1/mail/mail-ops.c.kill-ethread evolution-2.21.1/mail/mai
m->uri = g_strdup (uri);
m->data = data;
m->done = done;
-
+
- id = m->msg.seq;
- e_thread_put (mail_thread_new, (EMsg *)m);
+ id = m->base.seq;
+ mail_msg_unordered_push (m);
return id;
}
-
+
/* ** REMOVE FOLDER ******************************************************* */
-
+
struct _remove_folder_msg {
- struct _mail_msg msg;
+ MailMsg base;
-
+
char *uri;
gboolean removed;
-@@ -1355,18 +1315,15 @@ struct _remove_folder_msg {
+@@ -1372,18 +1332,15 @@ struct _remove_folder_msg {
void *data;
};
-
+
-static char *
-remove_folder_desc (struct _mail_msg *mm, int done)
+static gchar *
@@ -945,7 +973,7 @@ diff -up evolution-2.21.1/mail/mail-ops.c.kill-ethread evolution-2.21.1/mail/mai
-
return g_strdup_printf (_("Removing folder %s"), m->uri);
}
-
+
static void
-remove_folder_get (struct _mail_msg *mm)
+remove_folder_exec (struct _remove_folder_msg *m)
@@ -954,18 +982,18 @@ diff -up evolution-2.21.1/mail/mail-ops.c.kill-ethread evolution-2.21.1/mail/mai
CamelStore *store;
CamelFolder *folder;
GPtrArray *uids;
-@@ -1374,7 +1331,7 @@ remove_folder_get (struct _mail_msg *mm)
-
+@@ -1391,7 +1348,7 @@ remove_folder_get (struct _mail_msg *mm)
+
m->removed = FALSE;
-
+
- folder = mail_tool_uri_to_folder (m->uri, 0, &mm->ex);
+ folder = mail_tool_uri_to_folder (m->uri, 0, &m->base.ex);
if (!folder)
return;
-
-@@ -1394,16 +1351,14 @@ remove_folder_get (struct _mail_msg *mm)
+
+@@ -1411,16 +1368,14 @@ remove_folder_get (struct _mail_msg *mm)
camel_store_unsubscribe_folder (store, folder->full_name, NULL);
-
+
/* Then delete the folder from the store */
- camel_store_delete_folder (store, folder->full_name, &mm->ex);
- m->removed = !camel_exception_is_set (&mm->ex);
@@ -973,7 +1001,7 @@ diff -up evolution-2.21.1/mail/mail-ops.c.kill-ethread evolution-2.21.1/mail/mai
+ m->removed = !camel_exception_is_set (&m->base.ex);
camel_object_unref (folder);
}
-
+
static void
-remove_folder_got (struct _mail_msg *mm)
+remove_folder_done (struct _remove_folder_msg *m)
@@ -983,9 +1011,9 @@ diff -up evolution-2.21.1/mail/mail-ops.c.kill-ethread evolution-2.21.1/mail/mai
if (m->removed) {
/* FIXME: Remove this folder from the folder cache ??? */
}
-@@ -1413,18 +1368,17 @@ remove_folder_got (struct _mail_msg *mm)
+@@ -1430,18 +1385,17 @@ remove_folder_got (struct _mail_msg *mm)
}
-
+
static void
-remove_folder_free (struct _mail_msg *mm)
+remove_folder_free (struct _remove_folder_msg *m)
@@ -994,7 +1022,7 @@ diff -up evolution-2.21.1/mail/mail-ops.c.kill-ethread evolution-2.21.1/mail/mai
-
g_free (m->uri);
}
-
+
-static struct _mail_msg_op remove_folder_op = {
- remove_folder_desc,
- remove_folder_get,
@@ -1007,33 +1035,33 @@ diff -up evolution-2.21.1/mail/mail-ops.c.kill-ethread evolution-2.21.1/mail/mai
+ (MailMsgDoneFunc) remove_folder_done,
+ (MailMsgFreeFunc) remove_folder_free
};
-
+
void
-@@ -1432,59 +1386,56 @@ mail_remove_folder (const char *uri, voi
+@@ -1449,59 +1403,56 @@ mail_remove_folder (const char *uri, voi
{
struct _remove_folder_msg *m;
-
+
- m = mail_msg_new (&remove_folder_op, NULL, sizeof (*m));
+ m = mail_msg_new (&remove_folder_info);
m->uri = g_strdup (uri);
m->data = data;
m->done = done;
-
+
- e_thread_put (mail_thread_new, (EMsg *)m);
+ mail_msg_unordered_push (m);
}
-
+
/* ** SYNC FOLDER ********************************************************* */
-
+
struct _sync_folder_msg {
- struct _mail_msg msg;
+ MailMsg base;
-
+
CamelFolder *folder;
void (*done) (CamelFolder *folder, void *data);
void *data;
};
-
+
-static char *sync_folder_desc(struct _mail_msg *mm, int done)
+static gchar *
+sync_folder_desc (struct _sync_folder_msg *m)
@@ -1043,7 +1071,7 @@ diff -up evolution-2.21.1/mail/mail-ops.c.kill-ethread evolution-2.21.1/mail/mai
return g_strdup_printf (_("Storing folder \'%s\'"),
camel_folder_get_full_name (m->folder));
}
-
+
-static void sync_folder_sync(struct _mail_msg *mm)
+static void
+sync_folder_exec (struct _sync_folder_msg *m)
@@ -1053,7 +1081,7 @@ diff -up evolution-2.21.1/mail/mail-ops.c.kill-ethread evolution-2.21.1/mail/mai
- camel_folder_sync(m->folder, FALSE, &mm->ex);
+ camel_folder_sync(m->folder, FALSE, &m->base.ex);
}
-
+
-static void sync_folder_synced(struct _mail_msg *mm)
+static void
+sync_folder_done (struct _sync_folder_msg *m)
@@ -1063,7 +1091,7 @@ diff -up evolution-2.21.1/mail/mail-ops.c.kill-ethread evolution-2.21.1/mail/mai
if (m->done)
m->done(m->folder, m->data);
}
-
+
-static void sync_folder_free(struct _mail_msg *mm)
+static void
+sync_folder_free (struct _sync_folder_msg *m)
@@ -1072,7 +1100,7 @@ diff -up evolution-2.21.1/mail/mail-ops.c.kill-ethread evolution-2.21.1/mail/mai
-
camel_object_unref((CamelObject *)m->folder);
}
-
+
-static struct _mail_msg_op sync_folder_op = {
- sync_folder_desc,
- sync_folder_sync,
@@ -1085,47 +1113,47 @@ diff -up evolution-2.21.1/mail/mail-ops.c.kill-ethread evolution-2.21.1/mail/mai
+ (MailMsgDoneFunc) sync_folder_done,
+ (MailMsgFreeFunc) sync_folder_free
};
-
+
void
-@@ -1492,19 +1443,19 @@ mail_sync_folder(CamelFolder *folder, vo
+@@ -1509,19 +1460,19 @@ mail_sync_folder(CamelFolder *folder, vo
{
struct _sync_folder_msg *m;
-
+
- m = mail_msg_new(&sync_folder_op, NULL, sizeof(*m));
+ m = mail_msg_new(&sync_folder_info);
m->folder = folder;
camel_object_ref(folder);
m->data = data;
m->done = done;
-
+
- e_thread_put(mail_thread_queued_slow, (EMsg *)m);
+ mail_msg_slow_ordered_push (m);
}
-
+
/* ** SYNC STORE ********************************************************* */
-
+
struct _sync_store_msg {
- struct _mail_msg msg;
+ MailMsg base;
-
+
CamelStore *store;
int expunge;
-@@ -1512,9 +1463,9 @@ struct _sync_store_msg {
+@@ -1529,9 +1480,9 @@ struct _sync_store_msg {
void *data;
};
-
+
-static char *sync_store_desc(struct _mail_msg *mm, int done)
+static gchar *
+sync_store_desc (struct _sync_store_msg *m)
{
- struct _sync_store_msg *m = (struct _sync_store_msg *)mm;
char *uri, *res;
-
+
uri = camel_url_to_string(((CamelService *)m->store)->url, CAMEL_URL_HIDE_ALL);
-@@ -1527,33 +1478,31 @@ static char *sync_store_desc(struct _mai
+@@ -1544,33 +1495,31 @@ static char *sync_store_desc(struct _mai
return res;
}
-
+
-static void sync_store_sync(struct _mail_msg *mm)
+static void
+sync_store_exec (struct _sync_store_msg *m)
@@ -1135,7 +1163,7 @@ diff -up evolution-2.21.1/mail/mail-ops.c.kill-ethread evolution-2.21.1/mail/mai
- camel_store_sync(m->store, m->expunge, &mm->ex);
+ camel_store_sync(m->store, m->expunge, &m->base.ex);
}
-
+
-static void sync_store_synced(struct _mail_msg *mm)
+static void
+sync_store_done (struct _sync_store_msg *m)
@@ -1145,7 +1173,7 @@ diff -up evolution-2.21.1/mail/mail-ops.c.kill-ethread evolution-2.21.1/mail/mai
if (m->done)
m->done(m->store, m->data);
}
-
+
-static void sync_store_free(struct _mail_msg *mm)
+static void
+sync_store_free (struct _sync_store_msg *m)
@@ -1154,7 +1182,7 @@ diff -up evolution-2.21.1/mail/mail-ops.c.kill-ethread evolution-2.21.1/mail/mai
-
camel_object_unref(m->store);
}
-
+
-static struct _mail_msg_op sync_store_op = {
- sync_store_desc,
- sync_store_sync,
@@ -1167,12 +1195,12 @@ diff -up evolution-2.21.1/mail/mail-ops.c.kill-ethread evolution-2.21.1/mail/mai
+ (MailMsgDoneFunc) sync_store_done,
+ (MailMsgFreeFunc) sync_store_free
};
-
+
void
-@@ -1561,36 +1510,37 @@ mail_sync_store(CamelStore *store, int e
+@@ -1578,36 +1527,37 @@ mail_sync_store(CamelStore *store, int e
{
struct _sync_store_msg *m;
-
+
- m = mail_msg_new(&sync_store_op, NULL, sizeof(*m));
+ m = mail_msg_new(&sync_store_info);
m->store = store;
@@ -1180,20 +1208,20 @@ diff -up evolution-2.21.1/mail/mail-ops.c.kill-ethread evolution-2.21.1/mail/mai
camel_object_ref(store);
m->data = data;
m->done = done;
-
+
- e_thread_put(mail_thread_queued_slow, (EMsg *)m);
+ mail_msg_slow_ordered_push (m);
}
-
+
/* ******************************************************************************** */
-
+
-static char *refresh_folder_desc(struct _mail_msg *mm, int done)
+static gchar *
+refresh_folder_desc (struct _sync_folder_msg *m)
{
return g_strdup(_("Refreshing folder"));
}
-
+
-static void refresh_folder_refresh(struct _mail_msg *mm)
+static void
+refresh_folder_exec (struct _sync_folder_msg *m)
@@ -1203,7 +1231,7 @@ diff -up evolution-2.21.1/mail/mail-ops.c.kill-ethread evolution-2.21.1/mail/mai
- camel_folder_refresh_info(m->folder, &mm->ex);
+ camel_folder_refresh_info(m->folder, &m->base.ex);
}
-
+
/* we just use the sync stuff where we can, since it would be the same */
-static struct _mail_msg_op refresh_folder_op = {
- refresh_folder_desc,
@@ -1217,32 +1245,32 @@ diff -up evolution-2.21.1/mail/mail-ops.c.kill-ethread evolution-2.21.1/mail/mai
+ (MailMsgDoneFunc) sync_folder_done,
+ (MailMsgFreeFunc) sync_folder_free
};
-
+
void
-@@ -1598,35 +1548,36 @@ mail_refresh_folder(CamelFolder *folder,
+@@ -1615,35 +1565,36 @@ mail_refresh_folder(CamelFolder *folder,
{
struct _sync_folder_msg *m;
-
+
- m = mail_msg_new(&refresh_folder_op, NULL, sizeof(*m));
+ m = mail_msg_new(&refresh_folder_info);
m->folder = folder;
camel_object_ref(folder);
m->data = data;
m->done = done;
-
+
- e_thread_put(mail_thread_queued_slow, (EMsg *)m);
+ mail_msg_slow_ordered_push (m);
}
-
+
/* ******************************************************************************** */
-
+
-static char *expunge_folder_desc(struct _mail_msg *mm, int done)
+static gchar *
+expunge_folder_desc (struct _sync_folder_msg *m)
{
return g_strdup(_("Expunging folder"));
}
-
+
-static void expunge_folder_expunge(struct _mail_msg *mm)
+static void
+expunge_folder_exec (struct _sync_folder_msg *m)
@@ -1252,7 +1280,7 @@ diff -up evolution-2.21.1/mail/mail-ops.c.kill-ethread evolution-2.21.1/mail/mai
- camel_folder_expunge(m->folder, &mm->ex);
+ camel_folder_expunge(m->folder, &m->base.ex);
}
-
+
/* we just use the sync stuff where we can, since it would be the same */
-static struct _mail_msg_op expunge_folder_op = {
- expunge_folder_desc,
@@ -1266,34 +1294,34 @@ diff -up evolution-2.21.1/mail/mail-ops.c.kill-ethread evolution-2.21.1/mail/mai
+ (MailMsgDoneFunc) sync_folder_done,
+ (MailMsgFreeFunc) sync_folder_free
};
-
+
void
-@@ -1634,31 +1585,30 @@ mail_expunge_folder(CamelFolder *folder,
+@@ -1651,31 +1602,30 @@ mail_expunge_folder(CamelFolder *folder,
{
struct _sync_folder_msg *m;
-
+
- m = mail_msg_new(&expunge_folder_op, NULL, sizeof(*m));
+ m = mail_msg_new(&expunge_folder_info);
m->folder = folder;
camel_object_ref(folder);
m->data = data;
m->done = done;
-
+
- e_thread_put(mail_thread_queued_slow, (EMsg *)m);
+ mail_msg_slow_ordered_push (m);
}
-
+
/* ******************************************************************************** */
-
+
struct _empty_trash_msg {
- struct _mail_msg msg;
+ MailMsg base;
-
+
EAccount *account;
void (*done) (EAccount *account, void *data);
void *data;
};
-
+
-static char *empty_trash_desc(struct _mail_msg *mm, int done)
+static gchar *
+empty_trash_desc (struct _empty_trash_msg *m)
@@ -1305,10 +1333,10 @@ diff -up evolution-2.21.1/mail/mail-ops.c.kill-ethread evolution-2.21.1/mail/mai
return g_strdup_printf (_("Emptying trash in \'%s\'"),
m->account ? m->account->name : _("Local Folders"));
#else
-@@ -1666,49 +1616,48 @@ static char *empty_trash_desc(struct _ma
+@@ -1683,49 +1633,48 @@ static char *empty_trash_desc(struct _ma
#endif
}
-
+
-static void empty_trash_empty(struct _mail_msg *mm)
+static void
+empty_trash_exec (struct _empty_trash_msg *m)
@@ -1317,7 +1345,7 @@ diff -up evolution-2.21.1/mail/mail-ops.c.kill-ethread evolution-2.21.1/mail/mai
const char *evolution_dir;
CamelFolder *trash;
char *uri;
-
+
if (m->account) {
- trash = mail_tool_get_trash (m->account->source->url, FALSE, &mm->ex);
+ trash = mail_tool_get_trash (m->account->source->url, FALSE, &m->base.ex);
@@ -1328,14 +1356,14 @@ diff -up evolution-2.21.1/mail/mail-ops.c.kill-ethread evolution-2.21.1/mail/mai
+ trash = mail_tool_get_trash (uri, TRUE, &m->base.ex);
g_free (uri);
}
-
+
if (trash)
- camel_folder_expunge (trash, &mm->ex);
+ camel_folder_expunge (trash, &m->base.ex);
-
+
camel_object_unref (trash);
}
-
+
-static void empty_trash_emptied(struct _mail_msg *mm)
+static void
+empty_trash_done (struct _empty_trash_msg *m)
@@ -1345,7 +1373,7 @@ diff -up evolution-2.21.1/mail/mail-ops.c.kill-ethread evolution-2.21.1/mail/mai
if (m->done)
m->done(m->account, m->data);
}
-
+
-static void empty_trash_free(struct _mail_msg *mm)
+static void
+empty_trash_free (struct _empty_trash_msg *m)
@@ -1355,7 +1383,7 @@ diff -up evolution-2.21.1/mail/mail-ops.c.kill-ethread evolution-2.21.1/mail/mai
if (m->account)
g_object_unref(m->account);
}
-
+
-static struct _mail_msg_op empty_trash_op = {
- empty_trash_desc,
- empty_trash_empty,
@@ -1368,12 +1396,12 @@ diff -up evolution-2.21.1/mail/mail-ops.c.kill-ethread evolution-2.21.1/mail/mai
+ (MailMsgDoneFunc) empty_trash_done,
+ (MailMsgFreeFunc) empty_trash_free
};
-
+
void
-@@ -1716,20 +1665,20 @@ mail_empty_trash(EAccount *account, void
+@@ -1733,20 +1682,20 @@ mail_empty_trash(EAccount *account, void
{
struct _empty_trash_msg *m;
-
+
- m = mail_msg_new(&empty_trash_op, NULL, sizeof(*m));
+ m = mail_msg_new(&empty_trash_info);
m->account = account;
@@ -1381,23 +1409,23 @@ diff -up evolution-2.21.1/mail/mail-ops.c.kill-ethread evolution-2.21.1/mail/mai
g_object_ref(account);
m->data = data;
m->done = done;
-
+
- e_thread_put(mail_thread_queued_slow, (EMsg *)m);
+ mail_msg_slow_ordered_push (m);
}
-
+
/* ** GET MESSAGE(s) ***************************************************** */
-
+
struct _get_message_msg {
- struct _mail_msg msg;
+ MailMsg base;
-
+
CamelFolder *folder;
char *uid;
-@@ -1739,32 +1688,28 @@ struct _get_message_msg {
+@@ -1756,32 +1705,28 @@ struct _get_message_msg {
CamelOperation *cancel;
};
-
+
-static char *get_message_desc(struct _mail_msg *mm, int done)
+static gchar *
+get_message_desc (struct _get_message_msg *m)
@@ -1406,7 +1434,7 @@ diff -up evolution-2.21.1/mail/mail-ops.c.kill-ethread evolution-2.21.1/mail/mai
-
return g_strdup_printf(_("Retrieving message %s"), m->uid);
}
-
+
-static void get_message_get(struct _mail_msg *mm)
+static void
+get_message_exec (struct _get_message_msg *m)
@@ -1416,7 +1444,7 @@ diff -up evolution-2.21.1/mail/mail-ops.c.kill-ethread evolution-2.21.1/mail/mai
- m->message = camel_folder_get_message(m->folder, m->uid, &mm->ex);
+ m->message = camel_folder_get_message(m->folder, m->uid, &m->base.ex);
}
-
+
-static void get_message_got(struct _mail_msg *mm)
+static void
+get_message_done (struct _get_message_msg *m)
@@ -1426,7 +1454,7 @@ diff -up evolution-2.21.1/mail/mail-ops.c.kill-ethread evolution-2.21.1/mail/mai
if (m->done)
m->done(m->folder, m->uid, m->message, m->data);
}
-
+
-static void get_message_free(struct _mail_msg *mm)
+static void
+get_message_free (struct _get_message_msg *m)
@@ -1436,10 +1464,10 @@ diff -up evolution-2.21.1/mail/mail-ops.c.kill-ethread evolution-2.21.1/mail/mai
g_free (m->uid);
camel_object_unref (m->folder);
camel_operation_unref (m->cancel);
-@@ -1773,21 +1718,22 @@ static void get_message_free(struct _mai
+@@ -1790,21 +1735,22 @@ static void get_message_free(struct _mai
camel_object_unref (m->message);
}
-
+
-static struct _mail_msg_op get_message_op = {
- get_message_desc,
- get_message_get,
@@ -1452,7 +1480,7 @@ diff -up evolution-2.21.1/mail/mail-ops.c.kill-ethread evolution-2.21.1/mail/mai
+ (MailMsgDoneFunc) get_message_done,
+ (MailMsgFreeFunc) get_message_free
};
-
+
void
mail_get_message(CamelFolder *folder, const char *uid, void (*done) (CamelFolder *folder, const char *uid,
CamelMimeMessage *msg, void *data),
@@ -1460,22 +1488,22 @@ diff -up evolution-2.21.1/mail/mail-ops.c.kill-ethread evolution-2.21.1/mail/mai
+ void *data, MailMsgDispatchFunc dispatch)
{
struct _get_message_msg *m;
-
+
- m = mail_msg_new(&get_message_op, NULL, sizeof(*m));
+ m = mail_msg_new(&get_message_info);
m->folder = folder;
camel_object_ref(folder);
m->uid = g_strdup(uid);
-@@ -1795,37 +1741,37 @@ mail_get_message(CamelFolder *folder, co
+@@ -1812,37 +1758,37 @@ mail_get_message(CamelFolder *folder, co
m->done = (void (*) (CamelFolder *, const char *, CamelMimeMessage *, void *)) done;
m->cancel = camel_operation_new(NULL, NULL);
-
+
- e_thread_put(thread, (EMsg *)m);
+ dispatch (m);
}
-
+
typedef void (*get_done)(CamelFolder *folder, const char *uid, CamelMimeMessage *msg, void *data, CamelException *);
-
+
-static void get_messagex_got(struct _mail_msg *mm)
+static void
+get_messagex_done (struct _get_message_msg *m)
@@ -1488,7 +1516,7 @@ diff -up evolution-2.21.1/mail/mail-ops.c.kill-ethread evolution-2.21.1/mail/mai
+ done(m->folder, m->uid, m->message, m->data, &m->base.ex);
}
}
-
+
-static struct _mail_msg_op get_messagex_op = {
- get_message_desc,
- get_message_get,
@@ -1501,7 +1529,7 @@ diff -up evolution-2.21.1/mail/mail-ops.c.kill-ethread evolution-2.21.1/mail/mai
+ (MailMsgDoneFunc) get_messagex_done,
+ (MailMsgFreeFunc) get_message_free
};
-
+
/* This is temporary, to avoid having to rewrite everything that uses
mail_get_message; it adds an exception argument to the callback */
void
@@ -1510,32 +1538,32 @@ diff -up evolution-2.21.1/mail/mail-ops.c.kill-ethread evolution-2.21.1/mail/mai
+ void *data, MailMsgDispatchFunc dispatch)
{
struct _get_message_msg *m;
-
+
- m = mail_msg_new(&get_messagex_op, NULL, sizeof(*m));
+ m = mail_msg_new(&get_messagex_info);
m->folder = folder;
camel_object_ref(folder);
m->uid = g_strdup(uid);
-@@ -1833,13 +1779,13 @@ mail_get_messagex(CamelFolder *folder, c
+@@ -1850,13 +1796,13 @@ mail_get_messagex(CamelFolder *folder, c
m->done = (void (*) (CamelFolder *, const char *, CamelMimeMessage *, void *)) done;
m->cancel = camel_operation_new(NULL, NULL);
-
+
- e_thread_put(thread, (EMsg *)m);
+ dispatch (m);
}
-
+
/* ********************************************************************** */
-
+
struct _get_messages_msg {
- struct _mail_msg msg;
+ MailMsg base;
-
+
CamelFolder *folder;
GPtrArray *uids;
-@@ -1849,26 +1795,25 @@ struct _get_messages_msg {
+@@ -1866,26 +1812,25 @@ struct _get_messages_msg {
void *data;
};
-
+
-static char * get_messages_desc(struct _mail_msg *mm, int done)
+static gchar *
+get_messages_desc (struct _get_messages_msg *m)
@@ -1546,7 +1574,7 @@ diff -up evolution-2.21.1/mail/mail-ops.c.kill-ethread evolution-2.21.1/mail/mai
"Retrieving %d messages", m->uids->len),
m->uids->len);
}
-
+
-static void get_messages_get(struct _mail_msg *mm)
+static void
+get_messages_exec (struct _get_messages_msg *m)
@@ -1554,21 +1582,21 @@ diff -up evolution-2.21.1/mail/mail-ops.c.kill-ethread evolution-2.21.1/mail/mai
- struct _get_messages_msg *m = (struct _get_messages_msg *)mm;
int i;
CamelMimeMessage *message;
-
+
for (i=0; iuids->len; i++) {
int pc = ((i+1) * 100) / m->uids->len;
-
+
- message = camel_folder_get_message(m->folder, m->uids->pdata[i], &mm->ex);
- camel_operation_progress(mm->cancel, pc);
+ message = camel_folder_get_message(m->folder, m->uids->pdata[i], &m->base.ex);
+ camel_operation_progress(m->base.cancel, pc);
if (message == NULL)
break;
-
-@@ -1876,17 +1821,16 @@ static void get_messages_get(struct _mai
+
+@@ -1893,17 +1838,16 @@ static void get_messages_get(struct _mai
}
}
-
+
-static void get_messages_got(struct _mail_msg *mm)
+static void
+get_messages_done (struct _get_messages_msg *m)
@@ -1578,19 +1606,19 @@ diff -up evolution-2.21.1/mail/mail-ops.c.kill-ethread evolution-2.21.1/mail/mai
if (m->done)
m->done(m->folder, m->uids, m->messages, m->data);
}
-
+
-static void get_messages_free(struct _mail_msg *mm)
+static void
+get_messages_free (struct _get_messages_msg *m)
{
- struct _get_messages_msg *m = (struct _get_messages_msg *)mm;
int i;
-
+
em_utils_uids_free (m->uids);
-@@ -1898,11 +1842,12 @@ static void get_messages_free(struct _ma
+@@ -1915,11 +1859,12 @@ static void get_messages_free(struct _ma
camel_object_unref(m->folder);
}
-
+
-static struct _mail_msg_op get_messages_op = {
- get_messages_desc,
- get_messages_get,
@@ -1603,37 +1631,37 @@ diff -up evolution-2.21.1/mail/mail-ops.c.kill-ethread evolution-2.21.1/mail/mai
+ (MailMsgDoneFunc) get_messages_done,
+ (MailMsgFreeFunc) get_messages_free
};
-
+
void
-@@ -1912,7 +1857,7 @@ mail_get_messages(CamelFolder *folder, G
+@@ -1929,7 +1874,7 @@ mail_get_messages(CamelFolder *folder, G
{
struct _get_messages_msg *m;
-
+
- m = mail_msg_new(&get_messages_op, NULL, sizeof(*m));
+ m = mail_msg_new(&get_messages_info);
m->folder = folder;
camel_object_ref(folder);
m->uids = uids;
-@@ -1920,13 +1865,13 @@ mail_get_messages(CamelFolder *folder, G
+@@ -1937,13 +1882,13 @@ mail_get_messages(CamelFolder *folder, G
m->data = data;
m->done = done;
-
+
- e_thread_put(mail_thread_new, (EMsg *)m);
+ mail_msg_unordered_push (m);
}
-
+
/* ** SAVE MESSAGES ******************************************************* */
-
+
struct _save_messages_msg {
- struct _mail_msg msg;
+ MailMsg base;
-
+
CamelFolder *folder;
GPtrArray *uids;
-@@ -1935,10 +1880,9 @@ struct _save_messages_msg {
+@@ -1952,10 +1897,9 @@ struct _save_messages_msg {
void *data;
};
-
+
-static char *save_messages_desc(struct _mail_msg *mm, int done)
+static gchar *
+save_messages_desc (struct _save_messages_msg *m)
@@ -1643,9 +1671,9 @@ diff -up evolution-2.21.1/mail/mail-ops.c.kill-ethread evolution-2.21.1/mail/mai
return g_strdup_printf(ngettext("Saving %d message",
"Saving %d messsages", m->uids->len),
m->uids->len);
-@@ -1977,9 +1921,8 @@ save_prepare_part (CamelMimePart *mime_p
+@@ -1994,9 +1938,8 @@ save_prepare_part (CamelMimePart *mime_p
}
-
+
static void
-save_messages_save (struct _mail_msg *mm)
+save_messages_exec (struct _save_messages_msg *m)
@@ -1654,18 +1682,18 @@ diff -up evolution-2.21.1/mail/mail-ops.c.kill-ethread evolution-2.21.1/mail/mai
CamelStreamFilter *filtered_stream;
CamelMimeFilterFrom *from_filter;
CamelStream *stream;
-@@ -1996,8 +1939,8 @@ save_messages_save (struct _mail_msg *mm
+@@ -2013,8 +1956,8 @@ save_messages_save (struct _mail_msg *mm
CamelMimeMessage *message;
int pc = ((i+1) * 100) / m->uids->len;
-
+
- message = camel_folder_get_message(m->folder, m->uids->pdata[i], &mm->ex);
- camel_operation_progress(mm->cancel, pc);
+ message = camel_folder_get_message(m->folder, m->uids->pdata[i], &m->base.ex);
+ camel_operation_progress(m->base.cancel, pc);
if (message == NULL)
break;
-
-@@ -2009,7 +1952,7 @@ save_messages_save (struct _mail_msg *mm
+
+@@ -2026,7 +1969,7 @@ save_messages_save (struct _mail_msg *mm
|| camel_stream_flush(stream) == -1
|| camel_data_wrapper_write_to_stream((CamelDataWrapper *)message, (CamelStream *)filtered_stream) == -1
|| camel_stream_flush((CamelStream *)filtered_stream) == -1) {
@@ -1674,10 +1702,10 @@ diff -up evolution-2.21.1/mail/mail-ops.c.kill-ethread evolution-2.21.1/mail/mai
_("Error saving messages to: %s:\n %s"), m->path, strerror(errno));
g_free(from);
camel_object_unref((CamelObject *)message);
-@@ -2023,28 +1966,27 @@ save_messages_save (struct _mail_msg *mm
+@@ -2040,28 +1983,27 @@ save_messages_save (struct _mail_msg *mm
camel_object_unref(stream);
}
-
+
-static void save_messages_saved(struct _mail_msg *mm)
+static void
+save_messages_done (struct _save_messages_msg *m)
@@ -1687,7 +1715,7 @@ diff -up evolution-2.21.1/mail/mail-ops.c.kill-ethread evolution-2.21.1/mail/mai
if (m->done)
m->done(m->folder, m->uids, m->path, m->data);
}
-
+
-static void save_messages_free(struct _mail_msg *mm)
+static void
+save_messages_free (struct _save_messages_msg *m)
@@ -1698,7 +1726,7 @@ diff -up evolution-2.21.1/mail/mail-ops.c.kill-ethread evolution-2.21.1/mail/mai
camel_object_unref(m->folder);
g_free(m->path);
}
-
+
-static struct _mail_msg_op save_messages_op = {
- save_messages_desc,
- save_messages_save,
@@ -1711,48 +1739,48 @@ diff -up evolution-2.21.1/mail/mail-ops.c.kill-ethread evolution-2.21.1/mail/mai
+ (MailMsgDoneFunc) save_messages_done,
+ (MailMsgFreeFunc) save_messages_free
};
-
+
int
-@@ -2054,7 +1996,7 @@ mail_save_messages(CamelFolder *folder,
+@@ -2071,7 +2013,7 @@ mail_save_messages(CamelFolder *folder,
struct _save_messages_msg *m;
int id;
-
+
- m = mail_msg_new(&save_messages_op, NULL, sizeof(*m));
+ m = mail_msg_new(&save_messages_info);
m->folder = folder;
camel_object_ref(folder);
m->uids = uids;
-@@ -2062,8 +2004,8 @@ mail_save_messages(CamelFolder *folder,
+@@ -2079,8 +2021,8 @@ mail_save_messages(CamelFolder *folder,
m->data = data;
m->done = done;
-
+
- id = m->msg.seq;
- e_thread_put(mail_thread_new, (EMsg *)m);
+ id = m->base.seq;
+ mail_msg_unordered_push (m);
-
+
return id;
}
-@@ -2071,7 +2013,7 @@ mail_save_messages(CamelFolder *folder,
+@@ -2088,7 +2030,7 @@ mail_save_messages(CamelFolder *folder,
/* ** SAVE PART ******************************************************* */
-
+
struct _save_part_msg {
- struct _mail_msg msg;
+ MailMsg base;
-
+
CamelMimePart *part;
char *path;
-@@ -2080,27 +2022,27 @@ struct _save_part_msg {
+@@ -2097,27 +2039,27 @@ struct _save_part_msg {
gboolean readonly;
};
-
+
-static char *save_part_desc(struct _mail_msg *mm, int done)
+static gchar *
+save_part_desc (struct _save_part_msg *m)
{
return g_strdup(_("Saving attachment"));
}
-
+
static void
-save_part_save (struct _mail_msg *mm)
+save_part_exec (struct _save_part_msg *m)
@@ -1760,7 +1788,7 @@ diff -up evolution-2.21.1/mail/mail-ops.c.kill-ethread evolution-2.21.1/mail/mai
- struct _save_part_msg *m = (struct _save_part_msg *)mm;
CamelDataWrapper *content;
CamelStream *stream;
-
+
if(!m->readonly){
if (!(stream = camel_stream_vfs_new_with_uri (m->path, O_WRONLY | O_CREAT | O_TRUNC, 0644))) {
- camel_exception_setv (&mm->ex, CAMEL_EXCEPTION_SYSTEM,
@@ -1775,18 +1803,18 @@ diff -up evolution-2.21.1/mail/mail-ops.c.kill-ethread evolution-2.21.1/mail/mai
_("Cannot create output file: %s:\n %s"),
m->path, g_strerror (errno));
return;
-@@ -2110,7 +2052,7 @@ save_part_save (struct _mail_msg *mm)
-
+@@ -2127,7 +2069,7 @@ save_part_save (struct _mail_msg *mm)
+
if (camel_data_wrapper_decode_to_stream (content, stream) == -1
|| camel_stream_flush (stream) == -1)
- camel_exception_setv (&mm->ex, CAMEL_EXCEPTION_SYSTEM,
+ camel_exception_setv (&m->base.ex, CAMEL_EXCEPTION_SYSTEM,
_("Could not write data: %s"),
g_strerror (errno));
-
-@@ -2118,27 +2060,25 @@ save_part_save (struct _mail_msg *mm)
+
+@@ -2135,27 +2077,25 @@ save_part_save (struct _mail_msg *mm)
}
-
+
static void
-save_part_saved (struct _mail_msg *mm)
+save_part_done (struct _save_part_msg *m)
@@ -1797,7 +1825,7 @@ diff -up evolution-2.21.1/mail/mail-ops.c.kill-ethread evolution-2.21.1/mail/mai
- m->done (m->part, m->path, !camel_exception_is_set (&mm->ex), m->data);
+ m->done (m->part, m->path, !camel_exception_is_set (&m->base.ex), m->data);
}
-
+
static void
-save_part_free (struct _mail_msg *mm)
+save_part_free (struct _save_part_msg *m)
@@ -1806,7 +1834,7 @@ diff -up evolution-2.21.1/mail/mail-ops.c.kill-ethread evolution-2.21.1/mail/mai
camel_object_unref (m->part);
g_free (m->path);
}
-
+
-static struct _mail_msg_op save_part_op = {
- save_part_desc,
- save_part_save,
@@ -1819,9 +1847,9 @@ diff -up evolution-2.21.1/mail/mail-ops.c.kill-ethread evolution-2.21.1/mail/mai
+ (MailMsgDoneFunc) save_part_done,
+ (MailMsgFreeFunc) save_part_free
};
-
+
int
-@@ -2147,7 +2087,7 @@ mail_save_part (CamelMimePart *part, con
+@@ -2164,7 +2104,7 @@ mail_save_part (CamelMimePart *part, con
{
struct _save_part_msg *m;
int id;
@@ -1830,40 +1858,40 @@ diff -up evolution-2.21.1/mail/mail-ops.c.kill-ethread evolution-2.21.1/mail/mai
m->part = part;
camel_object_ref (part);
m->path = g_strdup (path);
-@@ -2155,8 +2095,8 @@ mail_save_part (CamelMimePart *part, con
+@@ -2172,8 +2112,8 @@ mail_save_part (CamelMimePart *part, con
m->done = done;
m->readonly = readonly;
-
+
- id = m->msg.seq;
- e_thread_put (mail_thread_new, (EMsg *)m);
+ id = m->base.seq;
+ mail_msg_unordered_push (m);
-
+
return id;
}
-@@ -2165,7 +2105,7 @@ mail_save_part (CamelMimePart *part, con
+@@ -2182,7 +2122,7 @@ mail_save_part (CamelMimePart *part, con
/* ** PREPARE OFFLINE ***************************************************** */
-
+
struct _prep_offline_msg {
- struct _mail_msg msg;
+ MailMsg base;
-
+
CamelOperation *cancel;
char *uri;
-@@ -2173,22 +2113,22 @@ struct _prep_offline_msg {
+@@ -2190,22 +2130,22 @@ struct _prep_offline_msg {
void *data;
};
-
+
-static void prep_offline_do(struct _mail_msg *mm)
+static void
+prep_offline_exec (struct _prep_offline_msg *m)
{
- struct _prep_offline_msg *m = (struct _prep_offline_msg *)mm;
CamelFolder *folder;
-
+
if (m->cancel)
camel_operation_register(m->cancel);
-
+
- folder = mail_tool_uri_to_folder(m->uri, 0, &mm->ex);
+ folder = mail_tool_uri_to_folder(m->uri, 0, &m->base.ex);
if (folder) {
@@ -1878,10 +1906,10 @@ diff -up evolution-2.21.1/mail/mail-ops.c.kill-ethread evolution-2.21.1/mail/mai
}
/* prepare_for_offline should do this? */
/* of course it should all be atomic, but ... */
-@@ -2200,28 +2140,27 @@ static void prep_offline_do(struct _mail
+@@ -2217,28 +2157,27 @@ static void prep_offline_do(struct _mail
camel_operation_unregister(m->cancel);
}
-
+
-static void prep_offline_done(struct _mail_msg *mm)
+static void
+prep_offline_done (struct _prep_offline_msg *m)
@@ -1891,7 +1919,7 @@ diff -up evolution-2.21.1/mail/mail-ops.c.kill-ethread evolution-2.21.1/mail/mai
if (m->done)
m->done(m->uri, m->data);
}
-
+
-static void prep_offline_free(struct _mail_msg *mm)
+static void
+prep_offline_free (struct _prep_offline_msg *m)
@@ -1902,7 +1930,7 @@ diff -up evolution-2.21.1/mail/mail-ops.c.kill-ethread evolution-2.21.1/mail/mai
camel_operation_unref(m->cancel);
g_free(m->uri);
}
-
+
-static struct _mail_msg_op prep_offline_op = {
- NULL, /* DO NOT CHANGE THIS, IT MUST BE NULL FOR CANCELLATION TO WORK */
- prep_offline_do,
@@ -1915,37 +1943,37 @@ diff -up evolution-2.21.1/mail/mail-ops.c.kill-ethread evolution-2.21.1/mail/mai
+ (MailMsgDoneFunc) prep_offline_done,
+ (MailMsgFreeFunc) prep_offline_free
};
-
+
void
-@@ -2232,7 +2171,7 @@ mail_prep_offline(const char *uri,
+@@ -2249,7 +2188,7 @@ mail_prep_offline(const char *uri,
{
struct _prep_offline_msg *m;
-
+
- m = mail_msg_new(&prep_offline_op, NULL, sizeof(*m));
+ m = mail_msg_new(&prep_offline_info);
m->cancel = cancel;
if (cancel)
camel_operation_ref(cancel);
-@@ -2240,13 +2179,13 @@ mail_prep_offline(const char *uri,
+@@ -2257,13 +2196,13 @@ mail_prep_offline(const char *uri,
m->data = data;
m->done = done;
-
+
- e_thread_put(mail_thread_queued_slow, (EMsg *)m);
+ mail_msg_slow_ordered_push (m);
}
-
+
/* ** GO OFFLINE ***************************************************** */
-
+
struct _set_offline_msg {
- struct _mail_msg msg;
+ MailMsg base;
-
+
CamelStore *store;
gboolean offline;
-@@ -2254,9 +2193,9 @@ struct _set_offline_msg {
+@@ -2271,9 +2210,9 @@ struct _set_offline_msg {
void *data;
};
-
+
-static char *set_offline_desc(struct _mail_msg *mm, int done)
+static gchar *
+set_offline_desc (struct _set_offline_msg *m)
@@ -1953,11 +1981,11 @@ diff -up evolution-2.21.1/mail/mail-ops.c.kill-ethread evolution-2.21.1/mail/mai
- struct _set_offline_msg *m = (struct _set_offline_msg *)mm;
char *service_name = camel_service_get_name (CAMEL_SERVICE (m->store), TRUE);
char *msg;
-
-@@ -2266,61 +2205,59 @@ static char *set_offline_desc(struct _ma
+
+@@ -2283,61 +2222,59 @@ static char *set_offline_desc(struct _ma
return msg;
}
-
+
-static void set_offline_do(struct _mail_msg *mm)
+static void
+set_offline_exec (struct _set_offline_msg *m)
@@ -1993,13 +2021,13 @@ diff -up evolution-2.21.1/mail/mail-ops.c.kill-ethread evolution-2.21.1/mail/mai
return;
}
}
-
+
if (m->offline)
camel_service_disconnect (CAMEL_SERVICE (m->store),
- TRUE, &mm->ex);
+ TRUE, &m->base.ex);
}
-
+
-static void set_offline_done(struct _mail_msg *mm)
+static void
+set_offline_done (struct _set_offline_msg *m)
@@ -2009,7 +2037,7 @@ diff -up evolution-2.21.1/mail/mail-ops.c.kill-ethread evolution-2.21.1/mail/mai
if (m->done)
m->done(m->store, m->data);
}
-
+
-static void set_offline_free(struct _mail_msg *mm)
+static void
+set_offline_free (struct _set_offline_msg *m)
@@ -2018,7 +2046,7 @@ diff -up evolution-2.21.1/mail/mail-ops.c.kill-ethread evolution-2.21.1/mail/mai
-
camel_object_unref(m->store);
}
-
+
-static struct _mail_msg_op set_offline_op = {
- set_offline_desc,
- set_offline_do,
@@ -2031,12 +2059,12 @@ diff -up evolution-2.21.1/mail/mail-ops.c.kill-ethread evolution-2.21.1/mail/mai
+ (MailMsgDoneFunc) set_offline_done,
+ (MailMsgFreeFunc) set_offline_free
};
-
+
int
-@@ -2337,61 +2274,59 @@ mail_store_set_offline (CamelStore *stor
+@@ -2354,61 +2291,59 @@ mail_store_set_offline (CamelStore *stor
if (offline)
camel_service_cancel_connect (CAMEL_SERVICE (store));
-
+
- m = mail_msg_new(&set_offline_op, NULL, sizeof(*m));
+ m = mail_msg_new(&set_offline_info);
m->store = store;
@@ -2044,17 +2072,17 @@ diff -up evolution-2.21.1/mail/mail-ops.c.kill-ethread evolution-2.21.1/mail/mai
m->offline = offline;
m->data = data;
m->done = done;
-
+
- id = m->msg.seq;
- e_thread_put(mail_thread_new, (EMsg *)m);
+ id = m->base.seq;
+ mail_msg_unordered_push (m);
-
+
return id;
}
-
+
/* ** Prepare OFFLINE ***************************************************** */
-
+
-static char *prepare_offline_desc(struct _mail_msg *mm, int done)
+static char *
+prepare_offline_desc (struct _set_offline_msg *m, int done)
@@ -2062,14 +2090,14 @@ diff -up evolution-2.21.1/mail/mail-ops.c.kill-ethread evolution-2.21.1/mail/mai
- struct _set_offline_msg *m = (struct _set_offline_msg *)mm;
char *service_name = camel_service_get_name (CAMEL_SERVICE (m->store), TRUE);
char *msg;
-
+
- msg = g_strdup_printf(_("Preparing account '%s' for offline"), service_name);
+ msg = g_strdup_printf (_("Preparing account '%s' for offline"), service_name);
g_free(service_name);
-
+
return msg;
}
-
+
-static void prepare_offline_do(struct _mail_msg *mm)
+static void
+prepare_offline_exec (struct _set_offline_msg *m)
@@ -2080,7 +2108,7 @@ diff -up evolution-2.21.1/mail/mail-ops.c.kill-ethread evolution-2.21.1/mail/mai
- &mm->ex);
+ &m->base.ex);
}
-
+
-static void prepare_offline_done(struct _mail_msg *mm)
+static void
+prepare_offline_done (struct _set_offline_msg *m)
@@ -2091,7 +2119,7 @@ diff -up evolution-2.21.1/mail/mail-ops.c.kill-ethread evolution-2.21.1/mail/mai
- m->done(m->store, m->data);
+ m->done (m->store, m->data);
}
-
+
-static void prepare_offline_free(struct _mail_msg *mm)
+static void
+prepare_offline_free (struct _set_offline_msg *m)
@@ -2101,7 +2129,7 @@ diff -up evolution-2.21.1/mail/mail-ops.c.kill-ethread evolution-2.21.1/mail/mai
- camel_object_unref(m->store);
+ camel_object_unref (m->store);
}
-
+
-static struct _mail_msg_op prepare_offline_op = {
- prepare_offline_desc,
- prepare_offline_do,
@@ -2114,39 +2142,39 @@ diff -up evolution-2.21.1/mail/mail-ops.c.kill-ethread evolution-2.21.1/mail/mai
+ (MailMsgDoneFunc) prepare_offline_done,
+ (MailMsgFreeFunc) prepare_offline_free
};
-
+
int
-@@ -2404,14 +2339,14 @@ mail_store_prepare_offline (CamelStore *
+@@ -2421,14 +2356,14 @@ mail_store_prepare_offline (CamelStore *
* thread won't get queued behind a hung connect op.
*/
-
+
- m = mail_msg_new(&prepare_offline_op, NULL, sizeof(*m));
+ m = mail_msg_new(&prepare_offline_info);
m->store = store;
camel_object_ref(store);
m->data = NULL;
m->done = NULL;
-
+
- id = m->msg.seq;
- e_thread_put(mail_thread_new, (EMsg *)m);
+ id = m->base.seq;
+ mail_msg_unordered_push (m);
-
+
return id;
}
-@@ -2428,7 +2363,7 @@ mail_execute_shell_command (CamelFilterD
-
+@@ -2445,7 +2380,7 @@ mail_execute_shell_command (CamelFilterD
+
/* Async service-checking/authtype-lookup code. */
struct _check_msg {
- struct _mail_msg msg;
+ MailMsg base;
-
+
char *url;
CamelProviderType type;
-@@ -2438,51 +2373,47 @@ struct _check_msg {
+@@ -2455,51 +2390,47 @@ struct _check_msg {
void *data;
};
-
+
-static char *
-check_service_describe(struct _mail_msg *mm, int complete)
+static gchar *
@@ -2154,14 +2182,14 @@ diff -up evolution-2.21.1/mail/mail-ops.c.kill-ethread evolution-2.21.1/mail/mai
{
return g_strdup(_("Checking Service"));
}
-
+
static void
-check_service_check(struct _mail_msg *mm)
+check_service_exec (struct _check_msg *m)
{
- struct _check_msg *m = (struct _check_msg *)mm;
CamelService *service;
-
+
- service = camel_session_get_service(session, m->url, m->type, &mm->ex);
+ service = camel_session_get_service(session, m->url, m->type, &m->base.ex);
if (!service) {
@@ -2169,12 +2197,12 @@ diff -up evolution-2.21.1/mail/mail-ops.c.kill-ethread evolution-2.21.1/mail/mai
+ camel_operation_unregister(m->base.cancel);
return;
}
-
+
- m->authtypes = camel_service_query_auth_types(service, &mm->ex);
+ m->authtypes = camel_service_query_auth_types(service, &m->base.ex);
camel_object_unref(service);
}
-
+
static void
-check_service_done(struct _mail_msg *mm)
+check_service_done (struct _check_msg *m)
@@ -2184,7 +2212,7 @@ diff -up evolution-2.21.1/mail/mail-ops.c.kill-ethread evolution-2.21.1/mail/mai
if (m->done)
m->done(m->url, m->type, m->authtypes, m->data);
}
-
+
static void
-check_service_free(struct _mail_msg *mm)
+check_service_free (struct _check_msg *m)
@@ -2194,7 +2222,7 @@ diff -up evolution-2.21.1/mail/mail-ops.c.kill-ethread evolution-2.21.1/mail/mai
g_free(m->url);
g_list_free(m->authtypes);
}
-
+
-static struct _mail_msg_op check_service_op = {
- check_service_describe,
- check_service_check,
@@ -2207,42 +2235,42 @@ diff -up evolution-2.21.1/mail/mail-ops.c.kill-ethread evolution-2.21.1/mail/mai
+ (MailMsgDoneFunc) check_service_done,
+ (MailMsgFreeFunc) check_service_free
};
-
+
int
-@@ -2491,14 +2422,14 @@ mail_check_service(const char *url, Came
+@@ -2508,14 +2439,14 @@ mail_check_service(const char *url, Came
struct _check_msg *m;
int id;
-
+
- m = mail_msg_new (&check_service_op, NULL, sizeof(*m));
+ m = mail_msg_new (&check_service_info);
m->url = g_strdup(url);
m->type = type;
m->done = done;
m->data = data;
-
+
- id = m->msg.seq;
- e_thread_put(mail_thread_new, (EMsg *)m);
+ id = m->base.seq;
+ mail_msg_unordered_push (m);
-
+
return id;
}
-diff -up evolution-2.21.1/mail/em-folder-utils.c.kill-ethread evolution-2.21.1/mail/em-folder-utils.c
---- evolution-2.21.1/mail/em-folder-utils.c.kill-ethread 2007-10-23 06:06:27.000000000 -0400
-+++ evolution-2.21.1/mail/em-folder-utils.c 2007-10-29 14:47:20.000000000 -0400
+diff -up evolution-2.21.4/mail/em-folder-utils.c.kill-ethread evolution-2.21.4/mail/em-folder-utils.c
+--- evolution-2.21.4/mail/em-folder-utils.c.kill-ethread 2007-11-29 23:24:04.000000000 -0500
++++ evolution-2.21.4/mail/em-folder-utils.c 2007-12-17 12:33:07.000000000 -0500
@@ -85,7 +85,7 @@ emfu_is_special_local_folder (const char
}
-
+
struct _EMCopyFolders {
- struct _mail_msg msg;
+ MailMsg base;
-
+
/* input data */
CamelStore *fromstore;
@@ -97,18 +97,15 @@ struct _EMCopyFolders {
int delete;
};
-
+
-static char *
-emft_copy_folders__desc (struct _mail_msg *mm, int complete)
+static gchar *
@@ -2252,7 +2280,7 @@ diff -up evolution-2.21.1/mail/em-folder-utils.c.kill-ethread evolution-2.21.1/m
-
return g_strdup_printf (_("Copying `%s' to `%s'"), m->frombase, m->tobase);
}
-
+
static void
-emft_copy_folders__copy (struct _mail_msg *mm)
+emft_copy_folders__exec (struct _EMCopyFolders *m)
@@ -2264,11 +2292,11 @@ diff -up evolution-2.21.1/mail/em-folder-utils.c.kill-ethread evolution-2.21.1/m
@@ -116,7 +113,7 @@ emft_copy_folders__copy (struct _mail_ms
const char *tmp;
int fromlen;
-
+
- if (!(fi = camel_store_get_folder_info (m->fromstore, m->frombase, flags, &mm->ex)))
+ if (!(fi = camel_store_get_folder_info (m->fromstore, m->frombase, flags, &m->base.ex)))
return;
-
+
pending = g_list_append (pending, fi);
@@ -156,8 +153,8 @@ emft_copy_folders__copy (struct _mail_ms
if ((info->flags & CAMEL_FOLDER_NOSELECT) == 0) {
@@ -2279,32 +2307,32 @@ diff -up evolution-2.21.1/mail/em-folder-utils.c.kill-ethread evolution-2.21.1/m
+ camel_store_rename_folder (m->fromstore, info->full_name, toname->str, &m->base.ex);
+ if (camel_exception_is_set (&m->base.ex))
goto exception;
-
+
/* this folder no longer exists, unsubscribe it */
@@ -166,16 +163,16 @@ emft_copy_folders__copy (struct _mail_ms
-
+
deleted = 1;
} else {
- if (!(fromfolder = camel_store_get_folder (m->fromstore, info->full_name, 0, &mm->ex)))
+ if (!(fromfolder = camel_store_get_folder (m->fromstore, info->full_name, 0, &m->base.ex)))
goto exception;
-
+
- if (!(tofolder = camel_store_get_folder (m->tostore, toname->str, CAMEL_STORE_FOLDER_CREATE, &mm->ex))) {
+ if (!(tofolder = camel_store_get_folder (m->tostore, toname->str, CAMEL_STORE_FOLDER_CREATE, &m->base.ex))) {
camel_object_unref (fromfolder);
goto exception;
}
-
+
uids = camel_folder_get_uids (fromfolder);
- camel_folder_transfer_messages_to (fromfolder, uids, tofolder, NULL, m->delete, &mm->ex);
+ camel_folder_transfer_messages_to (fromfolder, uids, tofolder, NULL, m->delete, &m->base.ex);
camel_folder_free_uids (fromfolder, uids);
-
+
if (m->delete)
@@ -186,7 +183,7 @@ emft_copy_folders__copy (struct _mail_ms
}
}
-
+
- if (camel_exception_is_set (&mm->ex))
+ if (camel_exception_is_set (&m->base.ex))
goto exception;
@@ -2312,7 +2340,7 @@ diff -up evolution-2.21.1/mail/em-folder-utils.c.kill-ethread evolution-2.21.1/m
deleting = g_list_prepend (deleting, info);
@@ -227,10 +224,8 @@ emft_copy_folders__copy (struct _mail_ms
}
-
+
static void
-emft_copy_folders__free (struct _mail_msg *mm)
+emft_copy_folders__free (struct _EMCopyFolders *m)
@@ -2321,11 +2349,11 @@ diff -up evolution-2.21.1/mail/em-folder-utils.c.kill-ethread evolution-2.21.1/m
-
camel_object_unref (m->fromstore);
camel_object_unref (m->tostore);
-
+
@@ -238,11 +233,12 @@ emft_copy_folders__free (struct _mail_ms
g_free (m->tobase);
}
-
+
-static struct _mail_msg_op copy_folders_op = {
- emft_copy_folders__desc,
- emft_copy_folders__copy,
@@ -2338,42 +2366,42 @@ diff -up evolution-2.21.1/mail/em-folder-utils.c.kill-ethread evolution-2.21.1/m
+ (MailMsgDoneFunc) NULL,
+ (MailMsgFreeFunc) emft_copy_folders__free
};
-
+
int
-@@ -251,7 +247,7 @@ em_folder_utils_copy_folders(CamelStore
+@@ -251,7 +247,7 @@ em_folder_utils_copy_folders(CamelStore
struct _EMCopyFolders *m;
int seq;
-
+
- m = mail_msg_new (©_folders_op, NULL, sizeof (struct _EMCopyFolders));
+ m = mail_msg_new (©_folders_info);
camel_object_ref (fromstore);
m->fromstore = fromstore;
camel_object_ref (tostore);
-@@ -259,9 +255,9 @@ em_folder_utils_copy_folders(CamelStore
+@@ -259,9 +255,9 @@ em_folder_utils_copy_folders(CamelStore
m->frombase = g_strdup (frombase);
m->tobase = g_strdup (tobase);
m->delete = delete;
- seq = m->msg.seq;
+ seq = m->base.seq;
-
+
- e_thread_put (mail_thread_new, (EMsg *) m);
+ mail_msg_unordered_push (m);
-
+
return seq;
}
@@ -558,7 +554,7 @@ em_folder_utils_rename_folder (CamelFold
}
-
+
struct _EMCreateFolder {
- struct _mail_msg msg;
+ MailMsg base;
-
+
/* input data */
CamelStore *store;
@@ -582,41 +578,33 @@ struct _EMCreateFolderTempData
char *uri;
};
-
+
-static char *
-emfu_create_folder__desc (struct _mail_msg *mm, int done)
+static gchar *
@@ -2383,7 +2411,7 @@ diff -up evolution-2.21.1/mail/em-folder-utils.c.kill-ethread evolution-2.21.1/m
-
return g_strdup_printf (_("Creating folder `%s'"), m->full_name);
}
-
+
static void
-emfu_create_folder__create (struct _mail_msg *mm)
+emfu_create_folder__exec (struct _EMCreateFolder *m)
@@ -2391,7 +2419,7 @@ diff -up evolution-2.21.1/mail/em-folder-utils.c.kill-ethread evolution-2.21.1/m
- struct _EMCreateFolder *m = (struct _EMCreateFolder *) mm;
-
d(printf ("creating folder parent='%s' name='%s' full_name='%s'\n", m->parent, m->name, m->full_name));
-
+
- if ((m->fi = camel_store_create_folder (m->store, m->parent, m->name, &mm->ex))) {
+ if ((m->fi = camel_store_create_folder (m->store, m->parent, m->name, &m->base.ex))) {
if (camel_store_supports_subscriptions (m->store))
@@ -2399,7 +2427,7 @@ diff -up evolution-2.21.1/mail/em-folder-utils.c.kill-ethread evolution-2.21.1/m
+ camel_store_subscribe_folder (m->store, m->full_name, &m->base.ex);
}
}
-
+
static void
-emfu_create_folder__created (struct _mail_msg *mm)
+emfu_create_folder__done (struct _EMCreateFolder *m)
@@ -2409,7 +2437,7 @@ diff -up evolution-2.21.1/mail/em-folder-utils.c.kill-ethread evolution-2.21.1/m
if (m->done)
m->done (m->fi, m->user_data);
}
-
+
static void
-emfu_create_folder__free (struct _mail_msg *mm)
+emfu_create_folder__free (struct _EMCreateFolder *m)
@@ -2422,7 +2450,7 @@ diff -up evolution-2.21.1/mail/em-folder-utils.c.kill-ethread evolution-2.21.1/m
@@ -624,11 +612,12 @@ emfu_create_folder__free (struct _mail_m
g_free (m->name);
}
-
+
-static struct _mail_msg_op create_folder_op = {
- emfu_create_folder__desc,
- emfu_create_folder__create,
@@ -2435,44 +2463,44 @@ diff -up evolution-2.21.1/mail/em-folder-utils.c.kill-ethread evolution-2.21.1/m
+ (MailMsgDoneFunc) emfu_create_folder__done,
+ (MailMsgFreeFunc) emfu_create_folder__free
};
-
-
+
+
@@ -649,7 +638,7 @@ emfu_create_folder_real (CamelStore *sto
parent = namebuf;
}
-
+
- m = mail_msg_new (&create_folder_op, NULL, sizeof (struct _EMCreateFolder));
+ m = mail_msg_new (&create_folder_info);
camel_object_ref (store);
m->store = store;
m->full_name = g_strdup (full_name);
@@ -660,8 +649,8 @@ emfu_create_folder_real (CamelStore *sto
-
+
g_free (namebuf);
-
+
- id = m->msg.seq;
- e_thread_put (mail_thread_new, (EMsg *) m);
+ id = m->base.seq;
+ mail_msg_unordered_push (m);
-
+
return id;
}
-diff -up evolution-2.21.1/mail/importers/elm-importer.c.kill-ethread evolution-2.21.1/mail/importers/elm-importer.c
---- evolution-2.21.1/mail/importers/elm-importer.c.kill-ethread 2007-10-23 06:06:23.000000000 -0400
-+++ evolution-2.21.1/mail/importers/elm-importer.c 2007-10-29 14:47:20.000000000 -0400
+diff -up evolution-2.21.4/mail/importers/elm-importer.c.kill-ethread evolution-2.21.4/mail/importers/elm-importer.c
+--- evolution-2.21.4/mail/importers/elm-importer.c.kill-ethread 2007-11-29 23:24:03.000000000 -0500
++++ evolution-2.21.4/mail/importers/elm-importer.c 2007-12-17 12:33:08.000000000 -0500
@@ -51,7 +51,7 @@
#define d(x) x
-
+
struct _elm_import_msg {
- struct _mail_msg msg;
+ MailMsg base;
-
+
EImport *import;
EImportTargetHome *target;
@@ -178,8 +178,8 @@ elm_supported(EImport *ei, EImportTarget
return mailexists;
}
-
+
-static char *
-elm_import_describe (struct _mail_msg *mm, int complete)
+static gchar *
@@ -2482,7 +2510,7 @@ diff -up evolution-2.21.1/mail/importers/elm-importer.c.kill-ethread evolution-2
}
@@ -190,9 +190,8 @@ static MailImporterSpecial elm_special_f
};
-
+
static void
-elm_import_import(struct _mail_msg *mm)
+elm_import_exec (struct _elm_import_msg *m)
@@ -2490,10 +2518,10 @@ diff -up evolution-2.21.1/mail/importers/elm-importer.c.kill-ethread evolution-2
- struct _elm_import_msg *m = (struct _elm_import_msg *) mm;
const char *maildir;
char *elmdir;
-
+
@@ -210,13 +209,11 @@ elm_import_import(struct _mail_msg *mm)
}
-
+
static void
-elm_import_imported(struct _mail_msg *mm)
+elm_import_done(struct _elm_import_msg *m)
@@ -2501,15 +2529,15 @@ diff -up evolution-2.21.1/mail/importers/elm-importer.c.kill-ethread evolution-2
- struct _elm_import_msg *m = (struct _elm_import_msg *)mm;
-
printf("importing complete\n");
-
+
- if (!camel_exception_is_set(&mm->ex)) {
+ if (!camel_exception_is_set(&m->base.ex)) {
GConfClient *gconf;
-
+
gconf = gconf_client_get_default();
@@ -228,10 +225,8 @@ elm_import_imported(struct _mail_msg *mm
}
-
+
static void
-elm_import_free(struct _mail_msg *mm)
+elm_import_free(struct _elm_import_msg *m)
@@ -2517,12 +2545,12 @@ diff -up evolution-2.21.1/mail/importers/elm-importer.c.kill-ethread evolution-2
- struct _elm_import_msg *m = (struct _elm_import_msg *)mm;
-
camel_operation_unref(m->status);
-
+
g_free(m->status_what);
@@ -280,11 +275,12 @@ elm_status_timeout(void *data)
return TRUE;
}
-
+
-static struct _mail_msg_op elm_import_op = {
- elm_import_describe,
- elm_import_import,
@@ -2535,12 +2563,12 @@ diff -up evolution-2.21.1/mail/importers/elm-importer.c.kill-ethread evolution-2
+ (MailMsgDoneFunc) elm_import_done,
+ (MailMsgFreeFunc) elm_import_free
};
-
+
static int
@@ -293,7 +289,7 @@ mail_importer_elm_import(EImport *ei, EI
struct _elm_import_msg *m;
int id;
-
+
- m = mail_msg_new(&elm_import_op, NULL, sizeof (*m));
+ m = mail_msg_new(&elm_import_info);
g_datalist_set_data(&target->data, "elm-msg", m);
@@ -2549,31 +2577,31 @@ diff -up evolution-2.21.1/mail/importers/elm-importer.c.kill-ethread evolution-2
@@ -302,9 +298,9 @@ mail_importer_elm_import(EImport *ei, EI
m->status_lock = g_mutex_new();
m->status = camel_operation_new(elm_status, m);
-
+
- id = m->msg.seq;
+ id = m->base.seq;
-
+
- e_thread_put(mail_thread_queued, (EMsg *)m);
+ mail_msg_fast_ordered_push (m);
-
+
return id;
}
-diff -up evolution-2.21.1/mail/importers/mail-importer.c.kill-ethread evolution-2.21.1/mail/importers/mail-importer.c
---- evolution-2.21.1/mail/importers/mail-importer.c.kill-ethread 2007-10-23 06:06:23.000000000 -0400
-+++ evolution-2.21.1/mail/importers/mail-importer.c 2007-10-29 14:47:50.000000000 -0400
+diff -up evolution-2.21.4/mail/importers/mail-importer.c.kill-ethread evolution-2.21.4/mail/importers/mail-importer.c
+--- evolution-2.21.4/mail/importers/mail-importer.c.kill-ethread 2007-11-29 23:24:03.000000000 -0500
++++ evolution-2.21.4/mail/importers/mail-importer.c 2007-12-17 12:33:08.000000000 -0500
@@ -132,7 +132,7 @@ struct _BonoboObject *mail_importer_fact
}
-
+
struct _import_mbox_msg {
- struct _mail_msg msg;
+ MailMsg base;
-
+
char *path;
char *uri;
@@ -142,8 +142,8 @@ struct _import_mbox_msg {
void *done_data;
};
-
+
-static char *
-import_mbox_describe(struct _mail_msg *mm, int complete)
+static gchar *
@@ -2583,7 +2611,7 @@ diff -up evolution-2.21.1/mail/importers/mail-importer.c.kill-ethread evolution-
}
@@ -190,9 +190,8 @@ decode_mozilla_status(const char *tmp)
}
-
+
static void
-import_mbox_import(struct _mail_msg *mm)
+import_mbox_exec (struct _import_mbox_msg *m)
@@ -2598,26 +2626,26 @@ diff -up evolution-2.21.1/mail/importers/mail-importer.c.kill-ethread evolution-
else
- folder = mail_tool_uri_to_folder(m->uri, CAMEL_STORE_FOLDER_CREATE, &mm->ex);
+ folder = mail_tool_uri_to_folder(m->uri, CAMEL_STORE_FOLDER_CREATE, &m->base.ex);
-
+
if (folder == NULL)
return;
@@ -262,11 +261,11 @@ import_mbox_import(struct _mail_msg *mm)
flags |= decode_status(tmp);
-
+
camel_message_info_set_flags(info, flags, ~0);
- camel_folder_append_message(folder, msg, info, NULL, &mm->ex);
+ camel_folder_append_message(folder, msg, info, NULL, &m->base.ex);
camel_message_info_free(info);
camel_object_unref(msg);
-
+
- if (camel_exception_is_set(&mm->ex))
+ if (camel_exception_is_set(&m->base.ex))
break;
-
- camel_mime_parser_step(mp, 0, 0);
+
+ camel_mime_parser_step(mp, NULL, NULL);
@@ -286,30 +285,27 @@ fail1:
}
-
+
static void
-import_mbox_done(struct _mail_msg *mm)
+import_mbox_done (struct _import_mbox_msg *m)
@@ -2628,7 +2656,7 @@ diff -up evolution-2.21.1/mail/importers/mail-importer.c.kill-ethread evolution-
- m->done(m->done_data, &mm->ex);
+ m->done(m->done_data, &m->base.ex);
}
-
+
static void
-import_mbox_free (struct _mail_msg *mm)
+import_mbox_free (struct _import_mbox_msg *m)
@@ -2640,7 +2668,7 @@ diff -up evolution-2.21.1/mail/importers/mail-importer.c.kill-ethread evolution-
g_free(m->uri);
g_free(m->path);
}
-
+
-static struct _mail_msg_op import_mbox_op = {
- import_mbox_describe,
- import_mbox_import,
@@ -2653,12 +2681,12 @@ diff -up evolution-2.21.1/mail/importers/mail-importer.c.kill-ethread evolution-
+ (MailMsgDoneFunc) import_mbox_done,
+ (MailMsgFreeFunc) import_mbox_free
};
-
+
int
@@ -318,7 +314,7 @@ mail_importer_import_mbox(const char *pa
struct _import_mbox_msg *m;
int id;
-
+
- m = mail_msg_new(&import_mbox_op, NULL, sizeof (*m));
+ m = mail_msg_new(&import_mbox_info);
m->path = g_strdup(path);
@@ -2667,18 +2695,18 @@ diff -up evolution-2.21.1/mail/importers/mail-importer.c.kill-ethread evolution-
@@ -328,8 +324,8 @@ mail_importer_import_mbox(const char *pa
camel_operation_ref(cancel);
}
-
+
- id = m->msg.seq;
- e_thread_put(mail_thread_queued, (EMsg *)m);
+ id = m->base.seq;
+ mail_msg_fast_ordered_push (m);
-
+
return id;
}
@@ -339,7 +335,7 @@ mail_importer_import_mbox_sync(const cha
{
struct _import_mbox_msg *m;
-
+
- m = mail_msg_new(&import_mbox_op, NULL, sizeof (*m));
+ m = mail_msg_new(&import_mbox_info);
m->path = g_strdup(path);
@@ -2687,7 +2715,7 @@ diff -up evolution-2.21.1/mail/importers/mail-importer.c.kill-ethread evolution-
@@ -347,9 +343,9 @@ mail_importer_import_mbox_sync(const cha
camel_operation_ref(cancel);
}
-
+
- import_mbox_import(&m->msg);
- import_mbox_done(&m->msg);
- mail_msg_free(&m->msg);
@@ -2695,24 +2723,24 @@ diff -up evolution-2.21.1/mail/importers/mail-importer.c.kill-ethread evolution-
+ import_mbox_done(m);
+ mail_msg_unref(m);
}
-
+
struct _import_folders_data {
-diff -up evolution-2.21.1/mail/importers/pine-importer.c.kill-ethread evolution-2.21.1/mail/importers/pine-importer.c
---- evolution-2.21.1/mail/importers/pine-importer.c.kill-ethread 2007-10-23 06:06:23.000000000 -0400
-+++ evolution-2.21.1/mail/importers/pine-importer.c 2007-10-29 14:47:20.000000000 -0400
+diff -up evolution-2.21.4/mail/importers/pine-importer.c.kill-ethread evolution-2.21.4/mail/importers/pine-importer.c
+--- evolution-2.21.4/mail/importers/pine-importer.c.kill-ethread 2007-11-29 23:24:03.000000000 -0500
++++ evolution-2.21.4/mail/importers/pine-importer.c 2007-12-17 12:33:08.000000000 -0500
@@ -56,7 +56,7 @@
#define d(x) x
-
+
struct _pine_import_msg {
- struct _mail_msg msg;
+ MailMsg base;
-
+
EImport *import;
EImportTarget *target;
@@ -223,8 +223,8 @@ import_contacts(void)
g_object_unref(book);
}
-
+
-static char *
-pine_import_describe (struct _mail_msg *mm, int complete)
+static gchar *
@@ -2722,7 +2750,7 @@ diff -up evolution-2.21.1/mail/importers/pine-importer.c.kill-ethread evolution-
}
@@ -236,10 +236,8 @@ static MailImporterSpecial pine_special_
};
-
+
static void
-pine_import_import(struct _mail_msg *mm)
+pine_import_exec(struct _pine_import_msg *m)
@@ -2731,10 +2759,10 @@ diff -up evolution-2.21.1/mail/importers/pine-importer.c.kill-ethread evolution-
-
if (GPOINTER_TO_INT(g_datalist_get_data(&m->target->data, "pine-do-addr")))
import_contacts();
-
+
@@ -253,13 +251,11 @@ pine_import_import(struct _mail_msg *mm)
}
-
+
static void
-pine_import_imported(struct _mail_msg *mm)
+pine_import_done(struct _pine_import_msg *m)
@@ -2742,15 +2770,15 @@ diff -up evolution-2.21.1/mail/importers/pine-importer.c.kill-ethread evolution-
- struct _pine_import_msg *m = (struct _pine_import_msg *)mm;
-
printf("importing complete\n");
-
+
- if (!camel_exception_is_set(&mm->ex)) {
+ if (!camel_exception_is_set(&m->base.ex)) {
GConfClient *gconf;
-
+
gconf = gconf_client_get_default();
@@ -274,10 +270,8 @@ pine_import_imported(struct _mail_msg *m
}
-
+
static void
-pine_import_free(struct _mail_msg *mm)
+pine_import_free(struct _pine_import_msg *m)
@@ -2758,12 +2786,12 @@ diff -up evolution-2.21.1/mail/importers/pine-importer.c.kill-ethread evolution-
- struct _pine_import_msg *m = (struct _pine_import_msg *)mm;
-
camel_operation_unref(m->status);
-
+
g_free(m->status_what);
@@ -326,11 +320,12 @@ pine_status_timeout(void *data)
return TRUE;
}
-
+
-static struct _mail_msg_op pine_import_op = {
- pine_import_describe,
- pine_import_import,
@@ -2776,12 +2804,12 @@ diff -up evolution-2.21.1/mail/importers/pine-importer.c.kill-ethread evolution-
+ (MailMsgDoneFunc) pine_import_done,
+ (MailMsgFreeFunc) pine_import_free
};
-
+
static int
@@ -339,7 +334,7 @@ mail_importer_pine_import(EImport *ei, E
struct _pine_import_msg *m;
int id;
-
+
- m = mail_msg_new(&pine_import_op, NULL, sizeof (*m));
+ m = mail_msg_new(&pine_import_info);
g_datalist_set_data(&target->data, "pine-msg", m);
@@ -2790,52 +2818,52 @@ diff -up evolution-2.21.1/mail/importers/pine-importer.c.kill-ethread evolution-
@@ -348,9 +343,9 @@ mail_importer_pine_import(EImport *ei, E
m->status_lock = g_mutex_new();
m->status = camel_operation_new(pine_status, m);
-
+
- id = m->msg.seq;
+ id = m->base.seq;
-
+
- e_thread_put(mail_thread_queued, (EMsg *)m);
+ mail_msg_fast_ordered_push (m);
-
+
return id;
}
-diff -up evolution-2.21.1/mail/em-utils.c.kill-ethread evolution-2.21.1/mail/em-utils.c
---- evolution-2.21.1/mail/em-utils.c.kill-ethread 2007-10-29 14:47:20.000000000 -0400
-+++ evolution-2.21.1/mail/em-utils.c 2007-10-29 14:47:20.000000000 -0400
-@@ -1912,7 +1912,7 @@ em_utils_in_addressbook(CamelInternetAdd
+diff -up evolution-2.21.4/mail/em-utils.c.kill-ethread evolution-2.21.4/mail/em-utils.c
+--- evolution-2.21.4/mail/em-utils.c.kill-ethread 2007-12-17 12:33:00.000000000 -0500
++++ evolution-2.21.4/mail/em-utils.c 2007-12-17 12:33:08.000000000 -0500
+@@ -1990,7 +1990,7 @@ em_utils_in_addressbook(CamelInternetAdd
ESource *source = s->data;
GList *contacts;
EBook *book;
- void *hook;
+ GHook *hook;
-
+
d(printf(" checking '%s'\n", e_source_get_uri(source)));
-
-diff -up evolution-2.21.1/mail/mail-vfolder.c.kill-ethread evolution-2.21.1/mail/mail-vfolder.c
---- evolution-2.21.1/mail/mail-vfolder.c.kill-ethread 2007-10-23 06:06:27.000000000 -0400
-+++ evolution-2.21.1/mail/mail-vfolder.c 2007-10-29 14:47:20.000000000 -0400
+
+diff -up evolution-2.21.4/mail/mail-vfolder.c.kill-ethread evolution-2.21.4/mail/mail-vfolder.c
+--- evolution-2.21.4/mail/mail-vfolder.c.kill-ethread 2007-11-29 23:24:04.000000000 -0500
++++ evolution-2.21.4/mail/mail-vfolder.c 2007-12-17 12:33:07.000000000 -0500
@@ -21,7 +21,7 @@
*/
-
+
#include
-
+#include
#include
-
+
#include
@@ -75,7 +75,7 @@ static void rule_changed(FilterRule *rul
/* ********************************************************************** */
-
+
struct _setup_msg {
- struct _mail_msg msg;
+ MailMsg base;
-
+
CamelFolder *folder;
char *query;
@@ -83,18 +83,15 @@ struct _setup_msg {
GList *sources_folder;
};
-
+
-static char *
-vfolder_setup_desc(struct _mail_msg *mm, int done)
+static gchar *
@@ -2845,7 +2873,7 @@ diff -up evolution-2.21.1/mail/mail-vfolder.c.kill-ethread evolution-2.21.1/mail
-
return g_strdup_printf(_("Setting up Search Folder: %s"), m->folder->full_name);
}
-
+
static void
-vfolder_setup_do(struct _mail_msg *mm)
+vfolder_setup_exec (struct _setup_msg *m)
@@ -2853,7 +2881,7 @@ diff -up evolution-2.21.1/mail/mail-vfolder.c.kill-ethread evolution-2.21.1/mail
- struct _setup_msg *m = (struct _setup_msg *)mm;
GList *l, *list = NULL;
CamelFolder *folder;
-
+
@@ -105,12 +102,12 @@ vfolder_setup_do(struct _mail_msg *mm)
l = m->sources_uri;
while (l && !shutdown) {
@@ -2871,7 +2899,7 @@ diff -up evolution-2.21.1/mail/mail-vfolder.c.kill-ethread evolution-2.21.1/mail
}
@@ -135,17 +132,13 @@ vfolder_setup_do(struct _mail_msg *mm)
}
-
+
static void
-vfolder_setup_done(struct _mail_msg *mm)
+vfolder_setup_done (struct _setup_msg *m)
@@ -2880,19 +2908,19 @@ diff -up evolution-2.21.1/mail/mail-vfolder.c.kill-ethread evolution-2.21.1/mail
-
- m = m;
}
-
+
static void
-vfolder_setup_free (struct _mail_msg *mm)
+vfolder_setup_free (struct _setup_msg *m)
{
- struct _setup_msg *m = (struct _setup_msg *)mm;
GList *l;
-
+
camel_object_unref(m->folder);
@@ -166,11 +159,12 @@ vfolder_setup_free (struct _mail_msg *mm
g_list_free(m->sources_folder);
}
-
+
-static struct _mail_msg_op vfolder_setup_op = {
- vfolder_setup_desc,
- vfolder_setup_do,
@@ -2905,12 +2933,12 @@ diff -up evolution-2.21.1/mail/mail-vfolder.c.kill-ethread evolution-2.21.1/mail
+ (MailMsgDoneFunc) vfolder_setup_done,
+ (MailMsgFreeFunc) vfolder_setup_free
};
-
+
/* sources_uri should be camel uri's */
@@ -180,15 +174,15 @@ vfolder_setup(CamelFolder *folder, const
struct _setup_msg *m;
int id;
-
+
- m = mail_msg_new(&vfolder_setup_op, NULL, sizeof (*m));
+ m = mail_msg_new(&vfolder_setup_info);
m->folder = folder;
@@ -2918,26 +2946,26 @@ diff -up evolution-2.21.1/mail/mail-vfolder.c.kill-ethread evolution-2.21.1/mail
m->query = g_strdup(query);
m->sources_uri = sources_uri;
m->sources_folder = sources_folder;
-
+
- id = m->msg.seq;
- e_thread_put(mail_thread_queued_slow, (EMsg *)m);
+ id = m->base.seq;
+ mail_msg_slow_ordered_push (m);
-
+
return id;
}
@@ -196,17 +190,16 @@ vfolder_setup(CamelFolder *folder, const
/* ********************************************************************** */
-
+
struct _adduri_msg {
- struct _mail_msg msg;
+ MailMsg base;
-
+
char *uri;
GList *folders;
int remove;
};
-
+
-static char *
-vfolder_adduri_desc(struct _mail_msg *mm, int done)
+static gchar *
@@ -2945,11 +2973,11 @@ diff -up evolution-2.21.1/mail/mail-vfolder.c.kill-ethread evolution-2.21.1/mail
{
- struct _adduri_msg *m = (struct _adduri_msg *)mm;
char *euri, *desc = NULL;
-
+
/* Yuck yuck. Lookup the account name and use that to describe the path */
@@ -250,9 +243,8 @@ vfolder_adduri_desc(struct _mail_msg *mm
}
-
+
static void
-vfolder_adduri_do(struct _mail_msg *mm)
+vfolder_adduri_exec (struct _adduri_msg *m)
@@ -2957,19 +2985,19 @@ diff -up evolution-2.21.1/mail/mail-vfolder.c.kill-ethread evolution-2.21.1/mail
- struct _adduri_msg *m = (struct _adduri_msg *)mm;
GList *l;
CamelFolder *folder = NULL;
-
+
@@ -269,7 +261,7 @@ vfolder_adduri_do(struct _mail_msg *mm)
}
-
+
if (folder == NULL)
- folder = mail_tool_uri_to_folder (m->uri, 0, &mm->ex);
+ folder = mail_tool_uri_to_folder (m->uri, 0, &m->base.ex);
-
+
if (folder != NULL) {
l = m->folders;
@@ -285,28 +277,24 @@ vfolder_adduri_do(struct _mail_msg *mm)
}
-
+
static void
-vfolder_adduri_done(struct _mail_msg *mm)
+vfolder_adduri_done(struct _adduri_msg *m)
@@ -2978,7 +3006,7 @@ diff -up evolution-2.21.1/mail/mail-vfolder.c.kill-ethread evolution-2.21.1/mail
-
- m = m;
}
-
+
static void
-vfolder_adduri_free (struct _mail_msg *mm)
+vfolder_adduri_free (struct _adduri_msg *m)
@@ -2989,7 +3017,7 @@ diff -up evolution-2.21.1/mail/mail-vfolder.c.kill-ethread evolution-2.21.1/mail
g_list_free(m->folders);
g_free(m->uri);
}
-
+
-static struct _mail_msg_op vfolder_adduri_op = {
- vfolder_adduri_desc,
- vfolder_adduri_do,
@@ -3002,55 +3030,55 @@ diff -up evolution-2.21.1/mail/mail-vfolder.c.kill-ethread evolution-2.21.1/mail
+ (MailMsgDoneFunc) vfolder_adduri_done,
+ (MailMsgFreeFunc) vfolder_adduri_free
};
-
-
+
+
@@ -317,13 +305,13 @@ vfolder_adduri(const char *uri, GList *f
struct _adduri_msg *m;
int id;
-
+
- m = mail_msg_new(&vfolder_adduri_op, NULL, sizeof (*m));
+ m = mail_msg_new(&vfolder_adduri_info);
m->folders = folders;
m->uri = g_strdup(uri);
m->remove = remove;
-
+
- id = m->msg.seq;
- e_thread_put(mail_thread_queued_slow, (EMsg *)m);
+ id = m->base.seq;
+ mail_msg_slow_ordered_push (m);
-
+
return id;
}
-@@ -447,7 +435,7 @@ mail_vfolder_add_uri(CamelStore *store,
+@@ -447,7 +435,7 @@ mail_vfolder_add_uri(CamelStore *store,
return;
}
-
+
- g_return_if_fail (pthread_equal(pthread_self(), mail_gui_thread));
+ g_return_if_fail (mail_in_main_thread());
-
+
is_ignore = uri_is_ignore(store, curi);
-
+
@@ -543,7 +531,7 @@ mail_vfolder_delete_uri(CamelStore *stor
-
+
d(printf ("Deleting uri to check: %s\n", uri));
-
+
- g_return_if_fail (pthread_equal(pthread_self(), mail_gui_thread));
+ g_return_if_fail (mail_in_main_thread());
-
+
changed = g_string_new ("");
-
+
@@ -627,7 +615,7 @@ mail_vfolder_rename_uri(CamelStore *stor
if (context == NULL || uri_is_spethal(store, cfrom) || uri_is_spethal(store, cto))
return;
-
+
- g_return_if_fail (pthread_equal(pthread_self(), mail_gui_thread));
+ g_return_if_fail (mail_in_main_thread());
-
+
from = em_uri_from_camel(cfrom);
to = em_uri_from_camel(cto);
-diff -up evolution-2.21.1/mail/em-format-html.c.kill-ethread evolution-2.21.1/mail/em-format-html.c
---- evolution-2.21.1/mail/em-format-html.c.kill-ethread 2007-10-23 06:06:27.000000000 -0400
-+++ evolution-2.21.1/mail/em-format-html.c 2007-10-29 14:47:20.000000000 -0400
+diff -up evolution-2.21.4/mail/em-format-html.c.kill-ethread evolution-2.21.4/mail/em-format-html.c
+--- evolution-2.21.4/mail/em-format-html.c.kill-ethread 2007-11-29 23:24:04.000000000 -0500
++++ evolution-2.21.4/mail/em-format-html.c 2007-12-17 12:33:08.000000000 -0500
@@ -176,7 +176,7 @@ efh_gtkhtml_destroy(GtkHTML *html, EMFor
if (efh->priv->format_timeout_id != 0) {
g_source_remove(efh->priv->format_timeout_id);
@@ -3059,27 +3087,27 @@ diff -up evolution-2.21.1/mail/em-format-html.c.kill-ethread evolution-2.21.1/ma
+ mail_msg_unref(efh->priv->format_timeout_msg);
efh->priv->format_timeout_msg = NULL;
}
-
+
@@ -1205,7 +1205,7 @@ efh_builtin_init(EMFormatHTMLClass *efhc
-
+
/* Sigh, this is so we have a cancellable, async rendering thread */
struct _format_msg {
- struct _mail_msg msg;
+ MailMsg base;
-
+
EMFormatHTML *format;
EMFormat *format_source;
@@ -1215,14 +1215,15 @@ struct _format_msg {
CamelMimeMessage *message;
};
-
+
-static char *efh_format_desc(struct _mail_msg *mm, int done)
+static gchar *
+efh_format_desc (struct _format_msg *m)
{
return g_strdup(_("Formatting message"));
}
-
+
-static void efh_format_do(struct _mail_msg *mm)
+static void
+efh_format_exec (struct _format_msg *m)
@@ -3091,7 +3119,7 @@ diff -up evolution-2.21.1/mail/em-format-html.c.kill-ethread evolution-2.21.1/ma
@@ -1307,10 +1308,9 @@ static void efh_format_do(struct _mail_m
((EMFormat *)m->format)->pending_uri_level = puri_level;
}
-
+
-static void efh_format_done(struct _mail_msg *mm)
+static void
+efh_format_done (struct _format_msg *m)
@@ -3099,12 +3127,12 @@ diff -up evolution-2.21.1/mail/em-format-html.c.kill-ethread evolution-2.21.1/ma
- struct _format_msg *m = (struct _format_msg *)mm;
-
d(printf("formatting finished\n"));
-
+
m->format->load_http_now = FALSE;
@@ -1318,10 +1318,9 @@ static void efh_format_done(struct _mail
g_signal_emit_by_name(m->format, "complete");
}
-
+
-static void efh_format_free(struct _mail_msg *mm)
+static void
+efh_format_free (struct _format_msg *m)
@@ -3117,7 +3145,7 @@ diff -up evolution-2.21.1/mail/em-format-html.c.kill-ethread evolution-2.21.1/ma
@@ -1337,11 +1336,12 @@ static void efh_format_free(struct _mail
g_object_unref(m->format_source);
}
-
+
-static struct _mail_msg_op efh_format_op = {
- efh_format_desc,
- efh_format_do,
@@ -3130,17 +3158,17 @@ diff -up evolution-2.21.1/mail/em-format-html.c.kill-ethread evolution-2.21.1/ma
+ (MailMsgDoneFunc) efh_format_done,
+ (MailMsgFreeFunc) efh_format_free
};
-
+
static gboolean
@@ -1352,7 +1352,7 @@ efh_format_timeout(struct _format_msg *m
struct _EMFormatHTMLPrivate *p = efh->priv;
-
+
if (m->format->html == NULL) {
- mail_msg_free(m);
+ mail_msg_unref(m);
return FALSE;
}
-
+
@@ -1380,7 +1380,7 @@ efh_format_timeout(struct _format_msg *m
if (m->message == NULL) {
hstream = gtk_html_begin(efh->html);
@@ -3149,19 +3177,19 @@ diff -up evolution-2.21.1/mail/em-format-html.c.kill-ethread evolution-2.21.1/ma
+ mail_msg_unref(m);
p->last_part = NULL;
} else {
- hstream = gtk_html_begin(efh->html);
-@@ -1402,8 +1402,8 @@ efh_format_timeout(struct _format_msg *m
+ if (p->last_part != m->message) {
+@@ -1403,8 +1403,8 @@ efh_format_timeout(struct _format_msg *m
p->last_part = m->message;
}
-
+
- efh->priv->format_id = m->msg.seq;
- e_thread_put(mail_thread_new, (EMsg *)m);
+ efh->priv->format_id = m->base.seq;
+ mail_msg_unordered_push (m);
}
-
+
efh->priv->format_timeout_id = 0;
-@@ -1427,11 +1427,11 @@ static void efh_format_clone(EMFormat *e
+@@ -1428,11 +1428,11 @@ static void efh_format_clone(EMFormat *e
d(printf(" timeout for last still active, removing ...\n"));
g_source_remove(efh->priv->format_timeout_id);
efh->priv->format_timeout_id = 0;
@@ -3169,48 +3197,48 @@ diff -up evolution-2.21.1/mail/em-format-html.c.kill-ethread evolution-2.21.1/ma
+ mail_msg_unref(efh->priv->format_timeout_msg);
efh->priv->format_timeout_msg = NULL;
}
-
+
- m = mail_msg_new(&efh_format_op, NULL, sizeof(*m));
+ m = mail_msg_new(&efh_format_info);
m->format = (EMFormatHTML *)emf;
g_object_ref(emf);
m->format_source = emfsource;
-diff -up evolution-2.21.1/mail/em-folder-properties.c.kill-ethread evolution-2.21.1/mail/em-folder-properties.c
---- evolution-2.21.1/mail/em-folder-properties.c.kill-ethread 2007-10-23 06:06:27.000000000 -0400
-+++ evolution-2.21.1/mail/em-folder-properties.c 2007-10-29 14:47:20.000000000 -0400
+diff -up evolution-2.21.4/mail/em-folder-properties.c.kill-ethread evolution-2.21.4/mail/em-folder-properties.c
+--- evolution-2.21.4/mail/em-folder-properties.c.kill-ethread 2007-11-29 23:24:04.000000000 -0500
++++ evolution-2.21.4/mail/em-folder-properties.c 2007-12-17 12:33:07.000000000 -0500
@@ -386,7 +386,7 @@ em_folder_properties_show(GtkWindow *par
}
-
+
if (folder == NULL)
- mail_get_folder(uri, 0, emfp_dialog_got_folder, NULL, mail_thread_new);
+ mail_get_folder(uri, 0, emfp_dialog_got_folder, NULL, mail_msg_unordered_push);
else
emfp_dialog_got_folder((char *)uri, folder, NULL);
}
-diff -up evolution-2.21.1/mail/em-folder-tree.c.kill-ethread evolution-2.21.1/mail/em-folder-tree.c
---- evolution-2.21.1/mail/em-folder-tree.c.kill-ethread 2007-10-23 06:06:27.000000000 -0400
-+++ evolution-2.21.1/mail/em-folder-tree.c 2007-10-29 14:47:20.000000000 -0400
-@@ -835,7 +835,7 @@ fail:
+diff -up evolution-2.21.4/mail/em-folder-tree.c.kill-ethread evolution-2.21.4/mail/em-folder-tree.c
+--- evolution-2.21.4/mail/em-folder-tree.c.kill-ethread 2007-12-14 09:25:49.000000000 -0500
++++ evolution-2.21.4/mail/em-folder-tree.c 2007-12-17 12:33:07.000000000 -0500
+@@ -846,7 +846,7 @@ fail:
/* TODO: Merge the drop handling code/menu's into one spot using a popup target for details */
/* Drop handling */
struct _DragDataReceivedAsync {
- struct _mail_msg msg;
+ MailMsg base;
-
+
/* input data */
GdkDragContext *context;
-@@ -860,17 +860,16 @@ emft_drop_folder(struct _DragDataReceive
-
+@@ -871,17 +871,16 @@ emft_drop_folder(struct _DragDataReceive
+
d(printf(" * Drop folder '%s' onto '%s'\n", m->selection->data, m->full_name));
-
+
- if (!(src = mail_tool_uri_to_folder((char *)m->selection->data, 0, &m->msg.ex)))
+ if (!(src = mail_tool_uri_to_folder((char *)m->selection->data, 0, &m->base.ex)))
return;
-
+
em_folder_utils_copy_folders(src->parent_store, src->full_name, m->store, m->full_name?m->full_name:"", m->move);
camel_object_unref(src);
}
-
+
-static char *
-emft_drop_async_desc (struct _mail_msg *mm, int done)
+static gchar *
@@ -3219,19 +3247,19 @@ diff -up evolution-2.21.1/mail/em-folder-tree.c.kill-ethread evolution-2.21.1/ma
- struct _DragDataReceivedAsync *m = (struct _DragDataReceivedAsync *) mm;
CamelURL *url;
char *buf;
-
-@@ -894,9 +893,8 @@ emft_drop_async_desc (struct _mail_msg *
+
+@@ -905,9 +904,8 @@ emft_drop_async_desc (struct _mail_msg *
}
-
+
static void
-emft_drop_async_drop (struct _mail_msg *mm)
+emft_drop_async__exec (struct _DragDataReceivedAsync *m)
{
- struct _DragDataReceivedAsync *m = (struct _DragDataReceivedAsync *) mm;
CamelFolder *folder;
-
+
/* for types other than folder, we can't drop to the root path */
-@@ -904,14 +902,14 @@ emft_drop_async_drop (struct _mail_msg *
+@@ -915,14 +913,14 @@ emft_drop_async_drop (struct _mail_msg *
/* copy or move (aka rename) a folder */
emft_drop_folder(m);
} else if (m->full_name == NULL) {
@@ -3250,16 +3278,16 @@ diff -up evolution-2.21.1/mail/em-folder-tree.c.kill-ethread evolution-2.21.1/ma
break;
case DND_DROP_TYPE_MESSAGE_RFC822:
/* import a message/rfc822 stream */
-@@ -929,10 +927,25 @@ emft_drop_async_drop (struct _mail_msg *
+@@ -940,10 +938,25 @@ emft_drop_async_drop (struct _mail_msg *
}
-
+
static void
-emft_drop_async_free (struct _mail_msg *mm)
+emft_drop_async__done (struct _DragDataReceivedAsync *m)
{
- struct _DragDataReceivedAsync *m = (struct _DragDataReceivedAsync *) mm;
+ gboolean success, delete;
-
+
+ /* ?? */
+ if (m->aborted) {
+ success = FALSE;
@@ -3268,7 +3296,7 @@ diff -up evolution-2.21.1/mail/em-folder-tree.c.kill-ethread evolution-2.21.1/ma
+ success = !camel_exception_is_set (&m->base.ex);
+ delete = success && m->move && !m->moved;
+ }
-+
++
+ gtk_drag_finish (m->context, success, delete, GDK_CURRENT_TIME);
+}
+
@@ -3278,10 +3306,10 @@ diff -up evolution-2.21.1/mail/em-folder-tree.c.kill-ethread evolution-2.21.1/ma
g_object_unref(m->context);
camel_object_unref(m->store);
g_free(m->full_name);
-@@ -941,18 +954,19 @@ emft_drop_async_free (struct _mail_msg *
+@@ -952,18 +965,19 @@ emft_drop_async_free (struct _mail_msg *
g_free(m->selection);
}
-
+
-static struct _mail_msg_op emft_drop_async_op = {
- emft_drop_async_desc,
- emft_drop_async_drop,
@@ -3294,7 +3322,7 @@ diff -up evolution-2.21.1/mail/em-folder-tree.c.kill-ethread evolution-2.21.1/ma
+ (MailMsgDoneFunc) emft_drop_async__done,
+ (MailMsgFreeFunc) emft_drop_async__free
};
-
+
static void
tree_drag_data_action(struct _DragDataReceivedAsync *m)
{
@@ -3302,39 +3330,39 @@ diff -up evolution-2.21.1/mail/em-folder-tree.c.kill-ethread evolution-2.21.1/ma
- e_thread_put (mail_thread_new, (EMsg *) m);
+ mail_msg_unordered_push (m);
}
-
+
static void
-@@ -979,7 +993,7 @@ emft_drop_popup_cancel(EPopup *ep, EPopu
+@@ -990,7 +1004,7 @@ emft_drop_popup_cancel(EPopup *ep, EPopu
struct _DragDataReceivedAsync *m = data;
-
+
m->aborted = TRUE;
- mail_msg_free(&m->msg);
+ mail_msg_unref(m);
}
-
+
static EPopupItem emft_drop_popup_menu[] = {
-@@ -1035,7 +1049,7 @@ tree_drag_data_received(GtkWidget *widge
+@@ -1046,7 +1060,7 @@ tree_drag_data_received(GtkWidget *widge
return;
}
-
+
- m = mail_msg_new (&emft_drop_async_op, NULL, sizeof (struct _DragDataReceivedAsync));
+ m = mail_msg_new (&emft_drop_async_info);
m->context = context;
g_object_ref(context);
m->store = store;
-@@ -1674,7 +1688,7 @@ dump_fi (CamelFolderInfo *fi, int depth)
+@@ -1685,7 +1699,7 @@ dump_fi (CamelFolderInfo *fi, int depth)
#endif
-
+
struct _EMFolderTreeGetFolderInfo {
- struct _mail_msg msg;
+ MailMsg base;
-
+
/* input data */
GtkTreeRowReference *root;
-@@ -1687,10 +1701,9 @@ struct _EMFolderTreeGetFolderInfo {
+@@ -1698,10 +1712,9 @@ struct _EMFolderTreeGetFolderInfo {
CamelFolderInfo *fi;
};
-
+
-static char *
-emft_get_folder_info__desc(struct _mail_msg *mm, int done)
+static gchar *
@@ -3342,22 +3370,22 @@ diff -up evolution-2.21.1/mail/em-folder-tree.c.kill-ethread evolution-2.21.1/ma
{
- struct _EMFolderTreeGetFolderInfo *m = (struct _EMFolderTreeGetFolderInfo *)mm;
char *ret, *name;
-
+
name = camel_service_get_name((CamelService *)m->store, TRUE);
-@@ -1700,18 +1713,16 @@ emft_get_folder_info__desc(struct _mail_
+@@ -1711,18 +1724,16 @@ emft_get_folder_info__desc(struct _mail_
}
-
+
static void
-emft_get_folder_info__get (struct _mail_msg *mm)
+emft_get_folder_info__exec (struct _EMFolderTreeGetFolderInfo *m)
{
- struct _EMFolderTreeGetFolderInfo *m = (struct _EMFolderTreeGetFolderInfo *) mm;
guint32 flags = m->flags | CAMEL_STORE_FOLDER_INFO_SUBSCRIBED;
-
+
- m->fi = camel_store_get_folder_info (m->store, m->top, flags, &mm->ex);
+ m->fi = camel_store_get_folder_info (m->store, m->top, flags, &m->base.ex);
}
-
+
static void
-emft_get_folder_info__got (struct _mail_msg *mm)
+emft_get_folder_info__done (struct _EMFolderTreeGetFolderInfo *m)
@@ -3366,18 +3394,18 @@ diff -up evolution-2.21.1/mail/em-folder-tree.c.kill-ethread evolution-2.21.1/ma
struct _EMFolderTreePrivate *priv = m->emft->priv;
struct _EMFolderTreeModelStoreInfo *si;
GtkTreeIter root, iter;
-@@ -1739,7 +1750,7 @@ emft_get_folder_info__got (struct _mail_
+@@ -1750,7 +1761,7 @@ emft_get_folder_info__got (struct _mail_
gtk_tree_model_get_iter ((GtkTreeModel *) model, &root, path);
-
+
/* if we had an error, then we need to re-set the load subdirs state and collapse the node */
- if (!m->fi && camel_exception_is_set(&mm->ex)) {
+ if (!m->fi && camel_exception_is_set(&m->base.ex)) {
gtk_tree_store_set(model, &root, COL_BOOL_LOAD_SUBDIRS, TRUE, -1);
gtk_tree_view_collapse_row (priv->treeview, path);
gtk_tree_path_free (path);
-@@ -1794,10 +1805,8 @@ emft_get_folder_info__got (struct _mail_
+@@ -1805,10 +1816,8 @@ emft_get_folder_info__got (struct _mail_
}
-
+
static void
-emft_get_folder_info__free (struct _mail_msg *mm)
+emft_get_folder_info__free (struct _EMFolderTreeGetFolderInfo *m)
@@ -3385,12 +3413,12 @@ diff -up evolution-2.21.1/mail/em-folder-tree.c.kill-ethread evolution-2.21.1/ma
- struct _EMFolderTreeGetFolderInfo *m = (struct _EMFolderTreeGetFolderInfo *) mm;
-
camel_store_free_folder_info (m->store, m->fi);
-
+
gtk_tree_row_reference_free (m->root);
-@@ -1806,11 +1815,12 @@ emft_get_folder_info__free (struct _mail
+@@ -1817,11 +1826,12 @@ emft_get_folder_info__free (struct _mail
g_free (m->top);
}
-
+
-static struct _mail_msg_op get_folder_info_op = {
- emft_get_folder_info__desc,
- emft_get_folder_info__get,
@@ -3403,42 +3431,42 @@ diff -up evolution-2.21.1/mail/em-folder-tree.c.kill-ethread evolution-2.21.1/ma
+ (MailMsgDoneFunc) emft_get_folder_info__done,
+ (MailMsgFreeFunc) emft_get_folder_info__free
};
-
+
static void
-@@ -1897,7 +1907,7 @@ emft_tree_row_expanded (GtkTreeView *tre
-
+@@ -1884,7 +1894,7 @@ emft_tree_row_expanded (GtkTreeView *tre
+
gtk_tree_store_set((GtkTreeStore *)model, root, COL_BOOL_LOAD_SUBDIRS, FALSE, -1);
-
+
- m = mail_msg_new (&get_folder_info_op, NULL, sizeof (struct _EMFolderTreeGetFolderInfo));
+ m = mail_msg_new (&get_folder_info_info);
m->root = gtk_tree_row_reference_new (model, tree_path);
camel_object_ref (store);
m->store = store;
-@@ -1906,7 +1916,7 @@ emft_tree_row_expanded (GtkTreeView *tre
+@@ -1893,7 +1903,7 @@ emft_tree_row_expanded (GtkTreeView *tre
m->top = full_name;
m->flags = CAMEL_STORE_FOLDER_INFO_RECURSIVE|CAMEL_STORE_FOLDER_INFO_FAST;
-
+
- e_thread_put (mail_thread_new, (EMsg *) m);
+ mail_msg_unordered_push (m);
}
-
+
static gboolean
-diff -up evolution-2.21.1/mail/em-folder-browser.c.kill-ethread evolution-2.21.1/mail/em-folder-browser.c
---- evolution-2.21.1/mail/em-folder-browser.c.kill-ethread 2007-10-23 06:06:27.000000000 -0400
-+++ evolution-2.21.1/mail/em-folder-browser.c 2007-10-29 14:47:20.000000000 -0400
-@@ -848,7 +848,7 @@ get_view_query (ESearchBar *esb)
-
-
+diff -up evolution-2.21.4/mail/em-folder-browser.c.kill-ethread evolution-2.21.4/mail/em-folder-browser.c
+--- evolution-2.21.4/mail/em-folder-browser.c.kill-ethread 2007-12-17 00:36:19.000000000 -0500
++++ evolution-2.21.4/mail/em-folder-browser.c 2007-12-17 12:33:07.000000000 -0500
+@@ -908,7 +908,7 @@ get_view_query (ESearchBar *esb, CamelFo
+
+
struct _setup_msg {
- struct _mail_msg msg;
+ MailMsg base;
-
+
CamelFolder *folder;
char *query;
-@@ -856,16 +856,15 @@ struct _setup_msg {
+@@ -916,16 +916,15 @@ struct _setup_msg {
GList *sources_folder;
};
-
+
-static char *
-vfolder_setup_desc(struct _mail_msg *mm, int done)
+static gchar *
@@ -3446,7 +3474,7 @@ diff -up evolution-2.21.1/mail/em-folder-browser.c.kill-ethread evolution-2.21.1
{
return g_strdup(_("Searching"));
}
-
+
static void
-vfolder_setup_do(struct _mail_msg *mm)
+vfolder_setup_exec(struct _setup_msg *m)
@@ -3454,8 +3482,8 @@ diff -up evolution-2.21.1/mail/em-folder-browser.c.kill-ethread evolution-2.21.1
- struct _setup_msg *m = (struct _setup_msg *)mm;
GList *l, *list = NULL;
CamelFolder *folder;
-
-@@ -876,12 +875,12 @@ vfolder_setup_do(struct _mail_msg *mm)
+
+@@ -936,12 +935,12 @@ vfolder_setup_do(struct _mail_msg *mm)
l = m->sources_uri;
while (l) {
d(printf(" Adding uri: %s\n", (char *)l->data));
@@ -3470,9 +3498,9 @@ diff -up evolution-2.21.1/mail/em-folder-browser.c.kill-ethread evolution-2.21.1
}
l = l->next;
}
-@@ -905,17 +904,13 @@ vfolder_setup_do(struct _mail_msg *mm)
+@@ -965,17 +964,13 @@ vfolder_setup_do(struct _mail_msg *mm)
}
-
+
static void
-vfolder_setup_done(struct _mail_msg *mm)
+vfolder_setup_done(struct _setup_msg *m)
@@ -3481,19 +3509,19 @@ diff -up evolution-2.21.1/mail/em-folder-browser.c.kill-ethread evolution-2.21.1
-
- m = m;
}
-
+
static void
-vfolder_setup_free (struct _mail_msg *mm)
+vfolder_setup_free (struct _setup_msg *m)
{
- struct _setup_msg *m = (struct _setup_msg *)mm;
GList *l;
-
+
camel_object_unref(m->folder);
-@@ -936,11 +931,12 @@ vfolder_setup_free (struct _mail_msg *mm
+@@ -996,11 +991,12 @@ vfolder_setup_free (struct _mail_msg *mm
g_list_free(m->sources_folder);
}
-
+
-static struct _mail_msg_op vfolder_setup_op = {
- vfolder_setup_desc,
- vfolder_setup_do,
@@ -3506,12 +3534,12 @@ diff -up evolution-2.21.1/mail/em-folder-browser.c.kill-ethread evolution-2.21.1
+ (MailMsgDoneFunc) vfolder_setup_done,
+ (MailMsgFreeFunc) vfolder_setup_free
};
-
+
/* sources_uri should be camel uri's */
-@@ -950,15 +946,15 @@ vfolder_setup(CamelFolder *folder, const
+@@ -1010,15 +1006,15 @@ vfolder_setup(CamelFolder *folder, const
struct _setup_msg *m;
int id;
-
+
- m = mail_msg_new(&vfolder_setup_op, NULL, sizeof (*m));
+ m = mail_msg_new(&vfolder_setup_info);
m->folder = folder;
@@ -3519,30 +3547,30 @@ diff -up evolution-2.21.1/mail/em-folder-browser.c.kill-ethread evolution-2.21.1
m->query = g_strdup(query);
m->sources_uri = sources_uri;
m->sources_folder = sources_folder;
-
+
- id = m->msg.seq;
- e_thread_put(mail_thread_queued_slow, (EMsg *)m);
+ id = m->base.seq;
+ mail_msg_slow_ordered_push (m);
-
+
return id;
}
-diff -up evolution-2.21.1/mail/message-list.c.kill-ethread evolution-2.21.1/mail/message-list.c
---- evolution-2.21.1/mail/message-list.c.kill-ethread 2007-10-28 22:02:16.000000000 -0400
-+++ evolution-2.21.1/mail/message-list.c 2007-10-29 14:47:20.000000000 -0400
-@@ -1848,7 +1848,7 @@ ml_tree_drag_data_get (ETree *tree, int
+diff -up evolution-2.21.4/mail/message-list.c.kill-ethread evolution-2.21.4/mail/message-list.c
+--- evolution-2.21.4/mail/message-list.c.kill-ethread 2007-12-17 00:36:27.000000000 -0500
++++ evolution-2.21.4/mail/message-list.c 2007-12-17 12:33:08.000000000 -0500
+@@ -1942,7 +1942,7 @@ ml_tree_drag_data_get (ETree *tree, int
/* TODO: merge this with the folder tree stuff via empopup targets */
/* Drop handling */
struct _drop_msg {
- struct _mail_msg msg;
+ MailMsg base;
-
+
GdkDragContext *context;
-
-@@ -1865,11 +1865,9 @@ struct _drop_msg {
+
+@@ -1959,11 +1959,9 @@ struct _drop_msg {
unsigned int aborted:1;
};
-
+
-static char *
-ml_drop_async_desc (struct _mail_msg *mm, int done)
+static gchar *
@@ -3553,9 +3581,9 @@ diff -up evolution-2.21.1/mail/message-list.c.kill-ethread evolution-2.21.1/mail
if (m->move)
return g_strdup_printf(_("Moving messages into folder %s"), m->folder->full_name);
else
-@@ -1877,13 +1875,11 @@ ml_drop_async_desc (struct _mail_msg *mm
+@@ -1971,13 +1969,11 @@ ml_drop_async_desc (struct _mail_msg *mm
}
-
+
static void
-ml_drop_async_drop(struct _mail_msg *mm)
+ml_drop_async_exec (struct _drop_msg *m)
@@ -3569,18 +3597,18 @@ diff -up evolution-2.21.1/mail/message-list.c.kill-ethread evolution-2.21.1/mail
break;
case DND_MESSAGE_RFC822:
em_utils_selection_get_message(m->selection, m->folder);
-@@ -1895,9 +1891,8 @@ ml_drop_async_drop(struct _mail_msg *mm)
+@@ -1989,9 +1985,8 @@ ml_drop_async_drop(struct _mail_msg *mm)
}
-
+
static void
-ml_drop_async_done(struct _mail_msg *mm)
+ml_drop_async_done (struct _drop_msg *m)
{
- struct _drop_msg *m = (struct _drop_msg *)mm;
gboolean success, delete;
-
+
/* ?? */
-@@ -1905,7 +1900,7 @@ ml_drop_async_done(struct _mail_msg *mm)
+@@ -1999,7 +1994,7 @@ ml_drop_async_done(struct _mail_msg *mm)
success = FALSE;
delete = FALSE;
} else {
@@ -3588,10 +3616,10 @@ diff -up evolution-2.21.1/mail/message-list.c.kill-ethread evolution-2.21.1/mail
+ success = !camel_exception_is_set (&m->base.ex);
delete = success && m->move && !m->moved;
}
-
-@@ -1913,10 +1908,8 @@ ml_drop_async_done(struct _mail_msg *mm)
+
+@@ -2007,10 +2002,8 @@ ml_drop_async_done(struct _mail_msg *mm)
}
-
+
static void
-ml_drop_async_free(struct _mail_msg *mm)
+ml_drop_async_free (struct _drop_msg *m)
@@ -3600,11 +3628,11 @@ diff -up evolution-2.21.1/mail/message-list.c.kill-ethread evolution-2.21.1/mail
-
g_object_unref(m->context);
camel_object_unref(m->folder);
-
-@@ -1924,18 +1917,19 @@ ml_drop_async_free(struct _mail_msg *mm)
+
+@@ -2018,18 +2011,19 @@ ml_drop_async_free(struct _mail_msg *mm)
g_free(m->selection);
}
-
+
-static struct _mail_msg_op ml_drop_async_op = {
- ml_drop_async_desc,
- ml_drop_async_drop,
@@ -3617,7 +3645,7 @@ diff -up evolution-2.21.1/mail/message-list.c.kill-ethread evolution-2.21.1/mail
+ (MailMsgDoneFunc) ml_drop_async_done,
+ (MailMsgFreeFunc) ml_drop_async_free
};
-
+
static void
ml_drop_action(struct _drop_msg *m)
{
@@ -3625,39 +3653,39 @@ diff -up evolution-2.21.1/mail/message-list.c.kill-ethread evolution-2.21.1/mail
- e_thread_put (mail_thread_new, (EMsg *) m);
+ mail_msg_unordered_push (m);
}
-
+
static void
-@@ -1962,7 +1956,7 @@ ml_drop_popup_cancel(EPopup *ep, EPopupI
+@@ -2056,7 +2050,7 @@ ml_drop_popup_cancel(EPopup *ep, EPopupI
struct _drop_msg *m = data;
-
+
m->aborted = TRUE;
- mail_msg_free(&m->msg);
+ mail_msg_unref(m);
}
-
+
static EPopupItem ml_drop_popup_menu[] = {
-@@ -1992,7 +1986,7 @@ ml_tree_drag_data_received (ETree *tree,
+@@ -2086,7 +2080,7 @@ ml_tree_drag_data_received (ETree *tree,
if (!ml->folder || data->data == NULL || data->length == -1)
return;
-
+
- m = mail_msg_new(&ml_drop_async_op, NULL, sizeof(*m));
+ m = mail_msg_new(&ml_drop_async_info);
m->context = context;
g_object_ref(context);
m->folder = ml->folder;
-@@ -3718,7 +3712,7 @@ save_hide_state (MessageList *ml)
-
+@@ -3811,7 +3805,7 @@ save_hide_state (MessageList *ml)
+
/* ** REGENERATE MESSAGELIST ********************************************** */
struct _regen_list_msg {
- struct _mail_msg msg;
+ MailMsg base;
-
+
int complete;
-
-@@ -3746,16 +3740,15 @@ struct _regen_list_msg {
-
+
+@@ -3841,16 +3835,15 @@ struct _regen_list_msg {
+
*/
-
+
-static char *
-regen_list_describe (struct _mail_msg *mm, gint complete)
+static gchar *
@@ -3665,7 +3693,7 @@ diff -up evolution-2.21.1/mail/message-list.c.kill-ethread evolution-2.21.1/mail
{
return g_strdup (_("Generating message list"));
}
-
+
static void
-regen_list_regen (struct _mail_msg *mm)
+regen_list_exec (struct _regen_list_msg *m)
@@ -3673,8 +3701,8 @@ diff -up evolution-2.21.1/mail/message-list.c.kill-ethread evolution-2.21.1/mail
- struct _regen_list_msg *m = (struct _regen_list_msg *)mm;
GPtrArray *uids, *uidnew, *showuids, *searchuids = NULL;
CamelMessageInfo *info;
- int i;
-@@ -3785,7 +3778,7 @@ regen_list_regen (struct _mail_msg *mm)
+ ETreePath cursor;
+@@ -3885,7 +3878,7 @@ regen_list_regen (struct _mail_msg *mm)
} else
expr = "(match-all (not (system-flag \"deleted\")))";
}
@@ -3682,8 +3710,8 @@ diff -up evolution-2.21.1/mail/message-list.c.kill-ethread evolution-2.21.1/mail
+ searchuids = uids = camel_folder_search_by_expression (m->folder, expr, &m->base.ex);
} else {
char *expr;
-
-@@ -3795,23 +3788,23 @@ regen_list_regen (struct _mail_msg *mm)
+
+@@ -3895,23 +3888,23 @@ regen_list_regen (struct _mail_msg *mm)
sprintf(expr, "(and (match-all (not (system-flag \"junk\")))\n %s)", m->search);
} else
expr = "(match-all (not (system-flag \"junk\")))";
@@ -3697,11 +3725,11 @@ diff -up evolution-2.21.1/mail/message-list.c.kill-ethread evolution-2.21.1/mail
uids = camel_folder_get_uids (m->folder);
}
}
-
+
- if (camel_exception_is_set (&mm->ex))
+ if (camel_exception_is_set (&m->base.ex))
return;
-
+
/* perform hiding */
if (m->hideexpr && camel_folder_has_search_capability(m->folder)) {
- uidnew = camel_folder_search_by_expression (m->ml->folder, m->hideexpr, &mm->ex);
@@ -3709,21 +3737,21 @@ diff -up evolution-2.21.1/mail/message-list.c.kill-ethread evolution-2.21.1/mail
/* well, lets not abort just because this faileld ... */
- camel_exception_clear (&mm->ex);
+ camel_exception_clear (&m->base.ex);
-
+
if (uidnew) {
MESSAGE_LIST_LOCK(m->ml, hide_lock);
-@@ -3886,7 +3879,7 @@ regen_list_regen (struct _mail_msg *mm)
-
+@@ -3998,7 +3991,7 @@ regen_list_regen (struct _mail_msg *mm)
+
e_profile_event_emit("list.threaduids", m->folder->full_name, 0);
-
+
- if (!camel_operation_cancel_check(mm->cancel)) {
+ if (!camel_operation_cancel_check(m->base.cancel)) {
/* update/build a new tree */
if (m->dotree) {
if (m->tree)
-@@ -3915,17 +3908,15 @@ regen_list_regen (struct _mail_msg *mm)
+@@ -4027,17 +4020,15 @@ regen_list_regen (struct _mail_msg *mm)
}
-
+
static void
-regen_list_regened (struct _mail_msg *mm)
+regen_list_done (struct _regen_list_msg *m)
@@ -3732,30 +3760,30 @@ diff -up evolution-2.21.1/mail/message-list.c.kill-ethread evolution-2.21.1/mail
-
if (m->ml->priv->destroyed)
return;
-
+
if (!m->complete)
return;
-
+
- if (camel_operation_cancel_check(mm->cancel))
+ if (camel_operation_cancel_check(m->base.cancel))
return;
-
+
if (m->ml->folder != m->folder)
-@@ -3976,9 +3967,8 @@ regen_list_regened (struct _mail_msg *mm
+@@ -4101,9 +4092,8 @@ regen_list_regened (struct _mail_msg *mm
}
-
+
static void
-regen_list_free (struct _mail_msg *mm)
+regen_list_free (struct _regen_list_msg *m)
{
- struct _regen_list_msg *m = (struct _regen_list_msg *)mm;
int i;
-
+
e_profile_event_emit("list.regenerated", m->folder->full_name, 0);
-@@ -4006,11 +3996,12 @@ regen_list_free (struct _mail_msg *mm)
+@@ -4131,11 +4121,12 @@ regen_list_free (struct _mail_msg *mm)
g_object_unref(m->ml);
}
-
+
-static struct _mail_msg_op regen_list_op = {
- regen_list_describe,
- regen_list_regen,
@@ -3768,27 +3796,27 @@ diff -up evolution-2.21.1/mail/message-list.c.kill-ethread evolution-2.21.1/mail
+ (MailMsgDoneFunc) regen_list_done,
+ (MailMsgFreeFunc) regen_list_free
};
-
+
static gboolean
-@@ -4020,7 +4011,7 @@ ml_regen_timeout(struct _regen_list_msg
-
+@@ -4145,7 +4136,7 @@ ml_regen_timeout(struct _regen_list_msg
+
m->ml->regen = g_list_prepend(m->ml->regen, m);
/* TODO: we should manage our own thread stuff, would make cancelling outstanding stuff easier */
- e_thread_put (mail_thread_queued, (EMsg *)m);
+ mail_msg_fast_ordered_push (m);
-
+
m->ml->regen_timeout_msg = NULL;
m->ml->regen_timeout_id = 0;
-@@ -4036,7 +4027,7 @@ mail_regen_cancel(MessageList *ml)
+@@ -4161,7 +4152,7 @@ mail_regen_cancel(MessageList *ml)
GList *l = ml->regen;
-
+
while (l) {
- struct _mail_msg *mm = l->data;
+ MailMsg *mm = l->data;
-
+
if (mm->cancel)
camel_operation_cancel(mm->cancel);
-@@ -4048,7 +4039,7 @@ mail_regen_cancel(MessageList *ml)
+@@ -4173,7 +4164,7 @@ mail_regen_cancel(MessageList *ml)
if (ml->regen_timeout_id) {
g_source_remove(ml->regen_timeout_id);
ml->regen_timeout_id = 0;
@@ -3797,22 +3825,22 @@ diff -up evolution-2.21.1/mail/message-list.c.kill-ethread evolution-2.21.1/mail
ml->regen_timeout_msg = NULL;
}
}
-@@ -4083,7 +4074,7 @@ mail_regen_list (MessageList *ml, const
+@@ -4208,7 +4199,7 @@ mail_regen_list (MessageList *ml, const
}
#endif
-
+
- m = mail_msg_new (®en_list_op, NULL, sizeof (*m));
+ m = mail_msg_new (®en_list_info);
m->ml = ml;
m->search = g_strdup (search);
m->hideexpr = g_strdup (hideexpr);
-diff -up evolution-2.21.1/mail/em-sync-stream.h.kill-ethread evolution-2.21.1/mail/em-sync-stream.h
---- evolution-2.21.1/mail/em-sync-stream.h.kill-ethread 2007-10-23 06:06:27.000000000 -0400
-+++ evolution-2.21.1/mail/em-sync-stream.h 2007-10-29 14:47:20.000000000 -0400
-@@ -29,41 +29,45 @@ requests are always handled in the main
+diff -up evolution-2.21.4/mail/em-sync-stream.h.kill-ethread evolution-2.21.4/mail/em-sync-stream.h
+--- evolution-2.21.4/mail/em-sync-stream.h.kill-ethread 2007-11-29 23:24:04.000000000 -0500
++++ evolution-2.21.4/mail/em-sync-stream.h 2007-12-17 12:33:08.000000000 -0500
+@@ -29,41 +29,45 @@ requests are always handled in the main
#ifndef EM_SYNC_STREAM_H
#define EM_SYNC_STREAM_H
-
+
-#ifdef __cplusplus
-extern "C" {
-#pragma }
@@ -3825,7 +3853,7 @@ diff -up evolution-2.21.1/mail/em-sync-stream.h.kill-ethread evolution-2.21.1/ma
-
#include
#include
-
+
-typedef struct _EMSyncStream {
- CamelStream parent_stream;
-
@@ -3851,14 +3879,14 @@ diff -up evolution-2.21.1/mail/em-sync-stream.h.kill-ethread evolution-2.21.1/ma
+ GString *buffer;
+ gboolean cancel;
+};
-
+
- int cancel;
-} EMSyncStream;
-
-typedef struct {
+struct _EMSyncStreamClass {
CamelStreamClass parent_class;
-
+
- ssize_t (*sync_write) (CamelStream *stream, const char *buffer, size_t n);
- int (*sync_close) (CamelStream *stream);
- int (*sync_flush) (CamelStream *stream);
@@ -3883,27 +3911,27 @@ diff -up evolution-2.21.1/mail/em-sync-stream.h.kill-ethread evolution-2.21.1/ma
+ gsize size);
+
+G_END_DECLS
-
+
#endif /* EM_SYNC_STREAM_H */
-diff -up evolution-2.21.1/mail/em-format-html-print.c.kill-ethread evolution-2.21.1/mail/em-format-html-print.c
---- evolution-2.21.1/mail/em-format-html-print.c.kill-ethread 2007-10-23 06:06:27.000000000 -0400
-+++ evolution-2.21.1/mail/em-format-html-print.c 2007-10-29 14:47:20.000000000 -0400
+diff -up evolution-2.21.4/mail/em-format-html-print.c.kill-ethread evolution-2.21.4/mail/em-format-html-print.c
+--- evolution-2.21.4/mail/em-format-html-print.c.kill-ethread 2007-10-23 06:06:27.000000000 -0400
++++ evolution-2.21.4/mail/em-format-html-print.c 2007-12-17 12:33:07.000000000 -0500
@@ -228,7 +228,7 @@ em_format_html_print_message (EMFormatHT
g_object_ref (efhp);
-
+
mail_get_message (
- folder, uid, emfhp_got_message, efhp, mail_thread_new);
+ folder, uid, emfhp_got_message, efhp, mail_msg_unordered_push);
}
-
+
void
-diff -up evolution-2.21.1/mail/em-sync-stream.c.kill-ethread evolution-2.21.1/mail/em-sync-stream.c
---- evolution-2.21.1/mail/em-sync-stream.c.kill-ethread 2007-10-23 06:06:27.000000000 -0400
-+++ evolution-2.21.1/mail/em-sync-stream.c 2007-10-29 14:47:20.000000000 -0400
+diff -up evolution-2.21.4/mail/em-sync-stream.c.kill-ethread evolution-2.21.4/mail/em-sync-stream.c
+--- evolution-2.21.4/mail/em-sync-stream.c.kill-ethread 2007-11-29 23:24:04.000000000 -0500
++++ evolution-2.21.4/mail/em-sync-stream.c 2007-12-17 12:33:08.000000000 -0500
@@ -25,42 +25,17 @@
#include
#endif
-
+
-#include
+#include "em-sync-stream.h"
+
@@ -3914,15 +3942,15 @@ diff -up evolution-2.21.1/mail/em-sync-stream.c.kill-ethread evolution-2.21.1/ma
-#include
-#include "em-sync-stream.h"
+#include
-
+
#include "mail-mt.h"
-
+
-#define LOG_STREAM
-
-#define d(x)
-
#define EMSS_CLASS(x) ((EMSyncStreamClass *)(((CamelObject *)(x))->klass))
-
+
-struct _EMSyncStreamPrivate {
- /* FIXME: use a single data port/gui channel for all instances */
- /* TODO: possibly just use one of the mail-mt ports ... */
@@ -3949,20 +3977,20 @@ diff -up evolution-2.21.1/mail/em-sync-stream.c.kill-ethread evolution-2.21.1/ma
EMSS_FLUSH,
@@ -68,275 +43,168 @@ enum _write_msg_t {
};
-
+
struct _write_msg {
- EMsg msg;
+ EMSyncStream *emss;
+ EFlag *done;
-
+
enum _write_msg_t op;
-
+
- const char *data;
- size_t n;
+ const gchar *string;
+ gsize len;
};
-
+
-static void em_sync_stream_class_init (EMSyncStreamClass *klass);
-static void em_sync_stream_init (CamelObject *object);
-static void em_sync_stream_finalize (CamelObject *object);
@@ -3972,7 +4000,7 @@ diff -up evolution-2.21.1/mail/em-sync-stream.c.kill-ethread evolution-2.21.1/ma
-static int stream_flush(CamelStream *stream);
-
static CamelStreamClass *parent_class = NULL;
-
+
-CamelType
-em_sync_stream_get_type (void)
-{
@@ -4035,7 +4063,7 @@ diff -up evolution-2.21.1/mail/em-sync-stream.c.kill-ethread evolution-2.21.1/ma
- p->buf_used = 0;
- }
+ struct _EMSyncStream *emss = msg->emss;
-
+
- /* FIXME: need to handle return values */
+ /* Force out any pending data before doing anything else. */
+ if (emss->buffer != NULL && emss->buffer->len > 0) {
@@ -4044,7 +4072,7 @@ diff -up evolution-2.21.1/mail/em-sync-stream.c.kill-ethread evolution-2.21.1/ma
+ emss->buffer->len);
+ g_string_set_size (emss->buffer, 0);
+ }
-
+
switch (msg->op) {
- case EMSS_WRITE:
- EMSS_CLASS(emss)->sync_write((CamelStream *)emss, msg->data, msg->n);
@@ -4078,7 +4106,7 @@ diff -up evolution-2.21.1/mail/em-sync-stream.c.kill-ethread evolution-2.21.1/ma
+ CAMEL_STREAM (emss));
+ break;
}
--
+
- e_msgport_reply((EMsg *)msg);
- d(printf("%p: gui sync op jobs done\n", emss));
-
@@ -4092,11 +4120,11 @@ diff -up evolution-2.21.1/mail/em-sync-stream.c.kill-ethread evolution-2.21.1/ma
- struct _EMSyncStreamPrivate *p;
-
- p = emss->priv = g_malloc0(sizeof(*p));
-
+-
- p->data_port = e_msgport_new();
- p->reply_port = e_msgport_new();
+ e_flag_set (msg->done);
-
+
-#ifndef G_OS_WIN32
- p->gui_channel = g_io_channel_unix_new(e_msgport_fd(p->data_port));
-#else
@@ -4118,7 +4146,7 @@ diff -up evolution-2.21.1/mail/em-sync-stream.c.kill-ethread evolution-2.21.1/ma
- d(printf("%p: new emss\n", emss));
+ return FALSE;
}
-
+
static void
-sync_op(EMSyncStream *emss, enum _write_msg_t op, const char *data, size_t n)
+emss_sync_op (EMSyncStream *emss, enum _write_msg_t op,
@@ -4129,7 +4157,7 @@ diff -up evolution-2.21.1/mail/em-sync-stream.c.kill-ethread evolution-2.21.1/ma
- EMsg *reply_msg;
-
- d(printf("%p: launching sync op %d\n", emss, op));
-
+
- /* we do everything synchronous, we should never have any locks, and
- this prevents overflow from banked up data */
-
@@ -4158,19 +4186,19 @@ diff -up evolution-2.21.1/mail/em-sync-stream.c.kill-ethread evolution-2.21.1/ma
- g_io_channel_unref(p->gui_channel);
+ msg.string = string;
+ msg.len = len;
-
+
- e_msgport_destroy(p->data_port);
- e_msgport_destroy(p->reply_port);
+ camel_object_ref (emss);
-
+
- p->data_port = NULL;
- p->reply_port = NULL;
+ g_idle_add ((GSourceFunc) emss_process_message, &msg);
-
+
- g_free(p->buf_data);
+ e_flag_wait (msg.done);
+ e_flag_free (msg.done);
-
+
-#ifdef LOG_STREAM
- if (p->logfd)
- fclose(p->logfd);
@@ -4179,7 +4207,7 @@ diff -up evolution-2.21.1/mail/em-sync-stream.c.kill-ethread evolution-2.21.1/ma
- g_free(p);
+ camel_object_unref (emss);
}
-
+
-static ssize_t
-stream_write (CamelStream *stream, const char *buffer, size_t n)
+static gssize
@@ -4187,10 +4215,10 @@ diff -up evolution-2.21.1/mail/em-sync-stream.c.kill-ethread evolution-2.21.1/ma
{
EMSyncStream *emss = EM_SYNC_STREAM (stream);
- struct _EMSyncStreamPrivate *p = emss->priv;
-
+
if (emss->cancel)
return -1;
-
+
- if (pthread_equal(pthread_self(), mail_gui_thread)) {
- EMSS_CLASS(emss)->sync_write(stream, buffer, n);
-#ifdef LOG_STREAM
@@ -4217,21 +4245,21 @@ diff -up evolution-2.21.1/mail/em-sync-stream.c.kill-ethread evolution-2.21.1/ma
- sync_op(emss, EMSS_WRITE, buffer, n);
+ emss_sync_op(emss, EMSS_WRITE, string, len);
}
-
+
- return (ssize_t) n;
+ return (gssize) len;
}
-
+
static int
-stream_flush(CamelStream *stream)
+emss_stream_flush (CamelStream *stream)
{
- EMSyncStream *emss = (EMSyncStream *)stream;
+ EMSyncStream *emss = EM_SYNC_STREAM (stream);
-
+
if (emss->cancel)
return -1;
-
+
- if (pthread_equal(pthread_self(), mail_gui_thread))
- return ((EMSyncStreamClass *)(((CamelObject *)emss)->klass))->sync_flush(stream);
+ if (mail_in_main_thread ())
@@ -4239,20 +4267,20 @@ diff -up evolution-2.21.1/mail/em-sync-stream.c.kill-ethread evolution-2.21.1/ma
else
- sync_op(emss, EMSS_FLUSH, NULL, 0);
+ emss_sync_op (emss, EMSS_FLUSH, NULL, 0);
-
+
return 0;
}
-
+
static int
-stream_close(CamelStream *stream)
+emss_stream_close (CamelStream *stream)
{
- EMSyncStream *emss = (EMSyncStream *)stream;
+ EMSyncStream *emss = EM_SYNC_STREAM (stream);
-
+
if (emss->cancel)
return -1;
-
+
- d(printf("%p: closing stream\n", stream));
-
- if (pthread_equal(pthread_self(), mail_gui_thread)) {
@@ -4269,10 +4297,10 @@ diff -up evolution-2.21.1/mail/em-sync-stream.c.kill-ethread evolution-2.21.1/ma
+ return EMSS_CLASS (emss)->sync_close (stream);
+ else
+ emss_sync_op (emss, EMSS_CLOSE, NULL, 0);
-
+
return 0;
}
-
+
-void
-em_sync_stream_set_buffer_size(EMSyncStream *emss, size_t size)
+static void
@@ -4310,7 +4338,7 @@ diff -up evolution-2.21.1/mail/em-sync-stream.c.kill-ethread evolution-2.21.1/ma
+ NULL,
+ (CamelObjectInitFunc) NULL,
+ (CamelObjectFinalizeFunc) em_sync_stream_finalize);
-
+
- g_free(p->buf_data);
- p->buf_data = g_malloc(size);
- p->buf_size = size;
@@ -4325,21 +4353,21 @@ diff -up evolution-2.21.1/mail/em-sync-stream.c.kill-ethread evolution-2.21.1/ma
+ g_string_free (emss->buffer, TRUE);
+ emss->buffer = g_string_sized_new (size);
}
-diff -up evolution-2.21.1/mail/em-subscribe-editor.c.kill-ethread evolution-2.21.1/mail/em-subscribe-editor.c
---- evolution-2.21.1/mail/em-subscribe-editor.c.kill-ethread 2007-10-23 06:06:27.000000000 -0400
-+++ evolution-2.21.1/mail/em-subscribe-editor.c 2007-10-29 14:47:20.000000000 -0400
+diff -up evolution-2.21.4/mail/em-subscribe-editor.c.kill-ethread evolution-2.21.4/mail/em-subscribe-editor.c
+--- evolution-2.21.4/mail/em-subscribe-editor.c.kill-ethread 2007-11-29 23:24:04.000000000 -0500
++++ evolution-2.21.4/mail/em-subscribe-editor.c 2007-12-17 12:33:07.000000000 -0500
@@ -173,7 +173,7 @@ sub_unref(EMSubscribe *sub)
/* ** Subscribe folder operation **************************************** */
-
+
struct _zsubscribe_msg {
- struct _mail_msg msg;
+ MailMsg base;
-
+
EMSubscribe *sub;
EMSubscribeNode *node;
@@ -182,20 +182,18 @@ struct _zsubscribe_msg {
};
-
+
static void
-sub_folder_subscribe (struct _mail_msg *mm)
+sub_folder_exec (struct _zsubscribe_msg *m)
@@ -4353,7 +4381,7 @@ diff -up evolution-2.21.1/mail/em-subscribe-editor.c.kill-ethread evolution-2.21
- camel_store_unsubscribe_folder (m->sub->store, m->node->info->full_name, &mm->ex);
+ camel_store_unsubscribe_folder (m->sub->store, m->node->info->full_name, &m->base.ex);
}
-
+
static void
-sub_folder_subscribed (struct _mail_msg *mm)
+sub_folder_done (struct _zsubscribe_msg *m)
@@ -4363,16 +4391,16 @@ diff -up evolution-2.21.1/mail/em-subscribe-editor.c.kill-ethread evolution-2.21
GtkTreeIter iter;
GtkTreeModel *model;
EMSubscribeNode *node;
-@@ -205,7 +203,7 @@ sub_folder_subscribed (struct _mail_msg
+@@ -205,7 +203,7 @@ sub_folder_subscribed (struct _mail_msg
if (m->sub->cancel)
return;
-
+
- if (!camel_exception_is_set(&mm->ex)) {
+ if (!camel_exception_is_set(&m->base.ex)) {
if (m->subscribe)
m->node->info->flags |= CAMEL_FOLDER_SUBSCRIBED;
else
-@@ -226,8 +224,8 @@ sub_folder_subscribed (struct _mail_msg
+@@ -226,8 +224,8 @@ sub_folder_subscribed (struct _mail_msg
/* queue any further ones, or if out, update the ui */
next = (struct _zsubscribe_msg *)e_dlist_remhead(&m->sub->subscribe);
if (next) {
@@ -4383,9 +4411,9 @@ diff -up evolution-2.21.1/mail/em-subscribe-editor.c.kill-ethread evolution-2.21
} else {
/* should it go off the model instead? */
sub_selection_changed(gtk_tree_view_get_selection(m->sub->tree), m->sub);
-@@ -235,19 +233,18 @@ sub_folder_subscribed (struct _mail_msg
+@@ -235,19 +233,18 @@ sub_folder_subscribed (struct _mail_msg
}
-
+
static void
-sub_folder_free (struct _mail_msg *mm)
+sub_folder_free (struct _zsubscribe_msg *m)
@@ -4395,7 +4423,7 @@ diff -up evolution-2.21.1/mail/em-subscribe-editor.c.kill-ethread evolution-2.21
g_free(m->path);
sub_unref(m->sub);
}
-
+
-static struct _mail_msg_op sub_subscribe_folder_op = {
- NULL, /*subscribe_folder_desc,*/
- sub_folder_subscribe,
@@ -4408,12 +4436,12 @@ diff -up evolution-2.21.1/mail/em-subscribe-editor.c.kill-ethread evolution-2.21
+ (MailMsgDoneFunc) sub_folder_done,
+ (MailMsgFreeFunc) sub_folder_free
};
-
+
/* spath is tree path in string form */
-@@ -257,18 +254,18 @@ sub_subscribe_folder (EMSubscribe *sub,
+@@ -257,18 +254,18 @@ sub_subscribe_folder (EMSubscribe *sub,
struct _zsubscribe_msg *m;
int id;
-
+
- m = mail_msg_new (&sub_subscribe_folder_op, NULL, sizeof(*m));
+ m = mail_msg_new (&sub_subscribe_folder_info);
m->sub = sub;
@@ -4421,7 +4449,7 @@ diff -up evolution-2.21.1/mail/em-subscribe-editor.c.kill-ethread evolution-2.21
m->node = node;
m->subscribe = state;
m->path = g_strdup(spath);
-
+
- id = m->msg.seq;
+ id = m->base.seq;
if (sub->subscribe_id == -1) {
@@ -4434,23 +4462,23 @@ diff -up evolution-2.21.1/mail/em-subscribe-editor.c.kill-ethread evolution-2.21
e_dlist_addtail(&sub->subscribe, (EDListNode *)m);
@@ -339,7 +336,7 @@ sub_fill_level(EMSubscribe *sub, CamelFo
/* async query of folderinfo */
-
+
struct _emse_folderinfo_msg {
- struct _mail_msg msg;
+ MailMsg base;
-
+
int seq;
-
+
@@ -349,31 +346,29 @@ struct _emse_folderinfo_msg {
};
-
+
static void
-sub_folderinfo_get (struct _mail_msg *mm)
+sub_folderinfo_exec (struct _emse_folderinfo_msg *m)
{
- struct _emse_folderinfo_msg *m = (struct _emse_folderinfo_msg *) mm;
char *pub_full_name=NULL;
-
+
if (m->seq == m->sub->seq) {
- camel_operation_register(mm->cancel);
- m->info = camel_store_get_folder_info(m->sub->store, m->node?m->node->info->full_name:pub_full_name, CAMEL_STORE_FOLDER_INFO_FAST | CAMEL_STORE_FOLDER_INFO_NO_VIRTUAL, &mm->ex);
@@ -4460,29 +4488,29 @@ diff -up evolution-2.21.1/mail/em-subscribe-editor.c.kill-ethread evolution-2.21
+ camel_operation_unregister(m->base.cancel);
}
}
-
+
static void
-sub_folderinfo_got(struct _mail_msg *mm)
+sub_folderinfo_done (struct _emse_folderinfo_msg *m)
{
- struct _emse_folderinfo_msg *m = (struct _emse_folderinfo_msg *) mm;
EMSubscribeNode *node;
-
+
m->sub->pending_id = -1;
if (m->sub->cancel || m->seq != m->sub->seq)
return;
-
+
- if (camel_exception_is_set (&mm->ex)) {
+ if (camel_exception_is_set (&m->base.ex)) {
g_warning ("Error getting folder info from store: %s",
- camel_exception_get_description (&mm->ex));
+ camel_exception_get_description (&m->base.ex));
}
-
+
if (m->info) {
@@ -394,10 +389,8 @@ sub_folderinfo_got(struct _mail_msg *mm)
}
-
+
static void
-sub_folderinfo_free(struct _mail_msg *mm)
+sub_folderinfo_free (struct _emse_folderinfo_msg *m)
@@ -4491,11 +4519,11 @@ diff -up evolution-2.21.1/mail/em-subscribe-editor.c.kill-ethread evolution-2.21
-
if (m->info)
m->sub->info_list = g_slist_prepend(m->sub->info_list, m->info);
-
+
@@ -413,11 +406,12 @@ sub_folderinfo_free(struct _mail_msg *mm
sub_unref(m->sub);
}
-
+
-static struct _mail_msg_op sub_folderinfo_op = {
- NULL, /*sub_folderinfo_desc, we do our own progress reporting/cancellation */
- sub_folderinfo_get,
@@ -4508,54 +4536,54 @@ diff -up evolution-2.21.1/mail/em-subscribe-editor.c.kill-ethread evolution-2.21
+ (MailMsgDoneFunc) sub_folderinfo_done,
+ (MailMsgFreeFunc) sub_folderinfo_free
};
-
+
static int
@@ -429,19 +423,19 @@ sub_queue_fill_level(EMSubscribe *sub, E
d(printf("%s:%d:%s: Starting get folderinfo of '%s'\n", __FILE__, __LINE__, __GNUC_PRETTY_FUNCTION__,
node?node->info->full_name:""));
-
+
- m = mail_msg_new (&sub_folderinfo_op, NULL, sizeof(*m));
+ m = mail_msg_new (&sub_folderinfo_info);
sub_ref(sub);
m->sub = sub;
m->node = node;
m->seq = sub->seq;
-
+
- sub->pending_id = m->msg.seq;
+ sub->pending_id = m->base.seq;
-
+
sub_editor_busy(sub->editor, 1);
-
+
- id = m->msg.seq;
+ id = m->base.seq;
-
+
- e_thread_put (mail_thread_new, (EMsg *)m);
+ mail_msg_unordered_push (m);
return id;
}
-
+
@@ -571,7 +565,7 @@ sub_destroy(GtkWidget *w, EMSubscribe *s
mail_msg_cancel(sub->subscribe_id);
-
+
while ( (m = (struct _zsubscribe_msg *)e_dlist_remhead(&sub->subscribe)) )
- mail_msg_free(m);
+ mail_msg_unref(m);
-
+
sub_unref(sub);
}
-diff -up evolution-2.21.1/mail/mail-mt.h.kill-ethread evolution-2.21.1/mail/mail-mt.h
---- evolution-2.21.1/mail/mail-mt.h.kill-ethread 2007-10-23 06:06:27.000000000 -0400
-+++ evolution-2.21.1/mail/mail-mt.h 2007-10-29 14:47:20.000000000 -0400
-@@ -23,47 +23,64 @@
+diff -up evolution-2.21.4/mail/mail-mt.h.kill-ethread evolution-2.21.4/mail/mail-mt.h
+--- evolution-2.21.4/mail/mail-mt.h.kill-ethread 2007-12-16 14:30:32.000000000 -0500
++++ evolution-2.21.4/mail/mail-mt.h 2007-12-17 12:33:08.000000000 -0500
+@@ -23,48 +23,65 @@
#ifndef _MAIL_MT
#define _MAIL_MT
-
+
-#include
#include "camel/camel-exception.h"
-#include "libedataserver/e-msgport.h"
#include "camel/camel-object.h"
#include "camel/camel-operation.h"
-
+
-typedef struct _mail_msg {
- EMsg msg; /* parent type */
- struct _mail_msg_op *ops; /* operation functions */
@@ -4580,7 +4608,7 @@ diff -up evolution-2.21.1/mail/mail-mt.h.kill-ethread evolution-2.21.1/mail/mail
-} mail_msg_t;
+ MailMsgPrivate *priv;
+};
-
+
-/* callback functions for thread message */
-typedef struct _mail_msg_op {
- char *(*describe_msg)(struct _mail_msg *msg, int complete);
@@ -4596,11 +4624,11 @@ diff -up evolution-2.21.1/mail/mail-mt.h.kill-ethread evolution-2.21.1/mail/mail
+ MailMsgDoneFunc done;
+ MailMsgFreeFunc free;
+};
-
+
/* setup ports */
void mail_msg_init(void);
void mail_msg_cleanup (void);
-
+
+gboolean mail_in_main_thread (void);
+
/* allocate a new message */
@@ -4615,7 +4643,7 @@ diff -up evolution-2.21.1/mail/mail-mt.h.kill-ethread evolution-2.21.1/mail/mail
void mail_msg_wait(unsigned int msgid);
void mail_msg_wait_all(void);
int mail_msg_active(unsigned int msgid);
-
+
+/* dispatch a message */
+void mail_msg_main_loop_push (gpointer msg);
+void mail_msg_unordered_push (gpointer msg);
@@ -4626,16 +4654,18 @@ diff -up evolution-2.21.1/mail/mail-mt.h.kill-ethread evolution-2.21.1/mail/mail
-void *mail_cancel_hook_add(GDestroyNotify func, void *data);
-void mail_cancel_hook_remove(void *handle);
-void mail_cancel_all(void);
+-void mail_msg_set_cancelable (struct _mail_msg *msg, gboolean status);
+GHook * mail_cancel_hook_add (GHookFunc func, gpointer data);
+void mail_cancel_hook_remove (GHook *hook);
+void mail_cancel_all (void);
-
++void mail_msg_set_cancelable (gpointer msg, gboolean status);
+
/* request a string/password */
char *mail_get_password (CamelService *service, const char *prompt,
-@@ -112,24 +129,6 @@ void *mail_call_main(mail_call_t type, M
+@@ -113,24 +130,6 @@ void *mail_call_main(mail_call_t type, M
void mail_enable_stop(void);
void mail_disable_stop(void);
-
+
-/* a message port that receives messages in the gui thread, used for sending port */
-extern EMsgPort *mail_gui_port;
-/* a message port that receives messages in the gui thread, used for the reply port */
@@ -4657,13 +4687,13 @@ diff -up evolution-2.21.1/mail/mail-mt.h.kill-ethread evolution-2.21.1/mail/mail
/* A generic proxy event for anything that can be proxied during the life of the mailer (almost nothing) */
/* Note that almost all objects care about the lifecycle of their events, so this cannot be used */
extern MailAsyncEvent *mail_async_event;
-diff -up evolution-2.21.1/mail/mail-ops.h.kill-ethread evolution-2.21.1/mail/mail-ops.h
---- evolution-2.21.1/mail/mail-ops.h.kill-ethread 2007-10-23 06:06:27.000000000 -0400
-+++ evolution-2.21.1/mail/mail-ops.h 2007-10-29 14:47:20.000000000 -0400
+diff -up evolution-2.21.4/mail/mail-ops.h.kill-ethread evolution-2.21.4/mail/mail-ops.h
+--- evolution-2.21.4/mail/mail-ops.h.kill-ethread 2007-11-29 23:24:04.000000000 -0500
++++ evolution-2.21.4/mail/mail-ops.h 2007-12-17 12:33:08.000000000 -0500
@@ -30,13 +30,14 @@ extern "C" {
#pragma }
#endif /* __cplusplus */
-
+
+#include "mail-mt.h"
+
#include "camel/camel-store.h"
@@ -4671,10 +4701,10 @@ diff -up evolution-2.21.1/mail/mail-ops.h.kill-ethread evolution-2.21.1/mail/mai
#include "camel/camel-filter-driver.h"
#include "camel/camel-mime-message.h"
#include "camel/camel-operation.h"
-
+
-#include "libedataserver/e-msgport.h"
#include "libedataserver/e-account.h"
-
+
void mail_append_mail (CamelFolder *folder, CamelMimeMessage *message, CamelMessageInfo *info,
@@ -55,12 +56,12 @@ void mail_transfer_messages (CamelFolder
void mail_get_message (CamelFolder *folder, const char *uid,
@@ -4682,13 +4712,13 @@ diff -up evolution-2.21.1/mail/mail-ops.h.kill-ethread evolution-2.21.1/mail/mai
void *data,
- EThread *thread);
+ MailMsgDispatchFunc dispatch);
-
+
void
mail_get_messagex(CamelFolder *folder, const char *uid,
void (*done) (CamelFolder *folder, const char *uid, CamelMimeMessage *msg, void *data, CamelException *),
- void *data, EThread *thread);
+ void *data, MailMsgDispatchFunc dispatch);
-
+
/* get several messages */
void mail_get_messages (CamelFolder *folder, GPtrArray *uids,
@@ -70,7 +71,7 @@ void mail_get_messages (CamelFolder *fol
@@ -4697,33 +4727,33 @@ diff -up evolution-2.21.1/mail/mail-ops.h.kill-ethread evolution-2.21.1/mail/mai
void (*done) (char *uri, CamelFolder *folder, void *data), void *data,
- EThread *thread);
+ MailMsgDispatchFunc dispatch);
-
+
/* and for a store */
int mail_get_store (const char *uri, CamelOperation *op,
-diff -up evolution-2.21.1/mail/em-composer-utils.c.kill-ethread evolution-2.21.1/mail/em-composer-utils.c
---- evolution-2.21.1/mail/em-composer-utils.c.kill-ethread 2007-10-23 06:06:27.000000000 -0400
-+++ evolution-2.21.1/mail/em-composer-utils.c 2007-10-29 14:47:20.000000000 -0400
+diff -up evolution-2.21.4/mail/em-composer-utils.c.kill-ethread evolution-2.21.4/mail/em-composer-utils.c
+--- evolution-2.21.4/mail/em-composer-utils.c.kill-ethread 2007-11-29 23:24:04.000000000 -0500
++++ evolution-2.21.4/mail/em-composer-utils.c 2007-12-17 12:33:08.000000000 -0500
@@ -557,7 +557,7 @@ em_utils_composer_save_draft_cb (EMsgCom
strcmp (account->drafts_folder_uri, default_drafts_folder_uri) != 0) {
int id;
-
+
- id = mail_get_folder (account->drafts_folder_uri, 0, save_draft_folder, &folder, mail_thread_new);
+ id = mail_get_folder (account->drafts_folder_uri, 0, save_draft_folder, &folder, mail_msg_unordered_push);
mail_msg_wait (id);
-
+
if (!folder || !account->enabled) {
@@ -1108,7 +1108,7 @@ em_utils_redirect_message_by_uid (CamelF
g_return_if_fail (CAMEL_IS_FOLDER (folder));
g_return_if_fail (uid != NULL);
-
+
- mail_get_message (folder, uid, redirect_msg, NULL, mail_thread_new);
+ mail_get_message (folder, uid, redirect_msg, NULL, mail_msg_unordered_push);
}
-
+
static void
@@ -1139,7 +1139,7 @@ em_utils_handle_receipt (CamelFolder *fo
}
-
+
if (msg == NULL) {
- mail_get_messagex(folder, uid, emu_handle_receipt_message, NULL, mail_thread_new);
+ mail_get_messagex(folder, uid, emu_handle_receipt_message, NULL, mail_msg_unordered_push);
@@ -4736,60 +4766,29 @@ diff -up evolution-2.21.1/mail/em-composer-utils.c.kill-ethread evolution-2.21.1
g_object_ref(rd->source);
- mail_get_message(folder, uid, reply_to_message, rd, mail_thread_new);
+ mail_get_message(folder, uid, reply_to_message, rd, mail_msg_unordered_push);
-
+
return;
}
@@ -2125,5 +2125,5 @@ em_utils_post_reply_to_message_by_uid (C
g_return_if_fail (CAMEL_IS_FOLDER (folder));
g_return_if_fail (uid != NULL);
-
+
- mail_get_message (folder, uid, post_reply_to_message, NULL, mail_thread_new);
+ mail_get_message (folder, uid, post_reply_to_message, NULL, mail_msg_unordered_push);
}
-diff -up evolution-2.21.1/mail/em-filter-i18n.h.kill-ethread evolution-2.21.1/mail/em-filter-i18n.h
---- evolution-2.21.1/mail/em-filter-i18n.h.kill-ethread 2007-10-29 03:19:19.000000000 -0400
-+++ evolution-2.21.1/mail/em-filter-i18n.h 2007-10-29 14:47:20.000000000 -0400
-@@ -3,7 +3,10 @@ char *s = N_("Adjust Score");
- char *s = N_("Assign Color");
- char *s = N_("Assign Score");
- char *s = N_("Attachments");
-+char *s = N_("BCC");
- char *s = N_("Beep");
-+char *s = N_("CC");
-+char *s = N_("Completed On");
- char *s = N_("contains");
- char *s = N_("Copy to Folder");
- char *s = N_("Date received");
-@@ -32,6 +35,8 @@ char *s = N_("is greater than");
- char *s = N_("is less than");
- char *s = N_("is not");
- char *s = N_("is not Flagged");
-+char *s = N_("is not set");
-+char *s = N_("is set");
- char *s = N_("Junk");
- char *s = N_("Junk Test");
- char *s = N_("Label");
-@@ -54,6 +59,7 @@ char *s = N_("returns less than");
- char *s = N_("Run Program");
- char *s = N_("Score");
- char *s = N_("Sender");
-+char *s = N_("Set Label");
- char *s = N_("Set Status");
- char *s = N_("Size (kB)");
- char *s = N_("sounds like");
-diff -up evolution-2.21.1/mail/mail-folder-cache.c.kill-ethread evolution-2.21.1/mail/mail-folder-cache.c
---- evolution-2.21.1/mail/mail-folder-cache.c.kill-ethread 2007-10-23 06:06:27.000000000 -0400
-+++ evolution-2.21.1/mail/mail-folder-cache.c 2007-10-29 14:47:20.000000000 -0400
-@@ -866,15 +866,14 @@ update_folders(CamelStore *store, CamelF
-
-
+diff -up evolution-2.21.4/mail/mail-folder-cache.c.kill-ethread evolution-2.21.4/mail/mail-folder-cache.c
+--- evolution-2.21.4/mail/mail-folder-cache.c.kill-ethread 2007-12-15 10:58:56.000000000 -0500
++++ evolution-2.21.4/mail/mail-folder-cache.c 2007-12-17 12:33:08.000000000 -0500
+@@ -808,15 +808,14 @@ update_folders(CamelStore *store, CamelF
+
+
struct _ping_store_msg {
- struct _mail_msg msg;
+ MailMsg base;
-
+
CamelStore *store;
};
-
+
-static char *
-ping_store_desc (struct _mail_msg *mm, int done)
+static gchar *
@@ -4798,27 +4797,27 @@ diff -up evolution-2.21.1/mail/mail-folder-cache.c.kill-ethread evolution-2.21.1
- struct _ping_store_msg *m = (struct _ping_store_msg *) mm;
char *service_name = camel_service_get_name (CAMEL_SERVICE (m->store), TRUE);
char *msg;
-
-@@ -885,10 +884,9 @@ ping_store_desc (struct _mail_msg *mm, i
+
+@@ -827,10 +826,9 @@ ping_store_desc (struct _mail_msg *mm, i
}
-
+
static void
-ping_store_ping (struct _mail_msg *mm)
+ping_store_exec (struct _ping_store_msg *m)
{
gboolean online = FALSE;
- struct _ping_store_msg *m = (struct _ping_store_msg *) mm;
-
+
if (CAMEL_SERVICE (m->store)->status == CAMEL_SERVICE_CONNECTED) {
if (CAMEL_IS_DISCO_STORE (m->store) &&
-@@ -899,22 +897,21 @@ ping_store_ping (struct _mail_msg *mm)
+@@ -841,22 +839,21 @@ ping_store_ping (struct _mail_msg *mm)
online = TRUE;
}
if (online)
- camel_store_noop (m->store, &mm->ex);
+ camel_store_noop (m->store, &m->base.ex);
}
-
+
static void
-ping_store_free (struct _mail_msg *mm)
+ping_store_free (struct _ping_store_msg *m)
@@ -4827,7 +4826,7 @@ diff -up evolution-2.21.1/mail/mail-folder-cache.c.kill-ethread evolution-2.21.1
-
camel_object_unref (m->store);
}
-
+
-static struct _mail_msg_op ping_store_op = {
- ping_store_desc,
- ping_store_ping,
@@ -4840,70 +4839,70 @@ diff -up evolution-2.21.1/mail/mail-folder-cache.c.kill-ethread evolution-2.21.1
+ (MailMsgDoneFunc) NULL,
+ (MailMsgFreeFunc) ping_store_free
};
-
+
static void
-@@ -926,11 +923,11 @@ ping_store (gpointer key, gpointer val,
+@@ -868,11 +865,11 @@ ping_store (gpointer key, gpointer val,
if (CAMEL_SERVICE (store)->status != CAMEL_SERVICE_CONNECTED)
return;
-
+
- m = mail_msg_new (&ping_store_op, NULL, sizeof (struct _ping_store_msg));
+ m = mail_msg_new (&ping_store_info);
m->store = store;
camel_object_ref (store);
-
+
- e_thread_put (mail_thread_queued_slow, (EMsg *) m);
+ mail_msg_slow_ordered_push (m);
}
-
+
static gboolean
-@@ -975,7 +972,7 @@ mail_note_store(CamelStore *store, Camel
+@@ -917,7 +914,7 @@ mail_note_store(CamelStore *store, Camel
int hook = 0;
-
+
g_return_if_fail (CAMEL_IS_STORE(store));
- g_return_if_fail (pthread_equal(pthread_self(), mail_gui_thread));
+ g_return_if_fail (mail_in_main_thread());
-
+
LOCK(info_lock);
-
-diff -up evolution-2.21.1/mail/em-folder-view.c.kill-ethread evolution-2.21.1/mail/em-folder-view.c
---- evolution-2.21.1/mail/em-folder-view.c.kill-ethread 2007-10-23 06:06:27.000000000 -0400
-+++ evolution-2.21.1/mail/em-folder-view.c 2007-10-29 14:47:20.000000000 -0400
-@@ -71,6 +71,7 @@
+
+diff -up evolution-2.21.4/mail/em-folder-view.c.kill-ethread evolution-2.21.4/mail/em-folder-view.c
+--- evolution-2.21.4/mail/em-folder-view.c.kill-ethread 2007-12-17 00:36:27.000000000 -0500
++++ evolution-2.21.4/mail/em-folder-view.c 2007-12-17 12:33:08.000000000 -0500
+@@ -72,6 +72,7 @@
#include
-
+
#include
+#include
-
+
#include "menus/gal-view-etable.h"
#include "menus/gal-view-factory-etable.h"
-@@ -777,7 +778,7 @@ emfv_got_folder(char *uri, CamelFolder *
+@@ -778,7 +779,7 @@ emfv_got_folder(char *uri, CamelFolder *
static void
emfv_set_folder_uri(EMFolderView *emfv, const char *uri)
{
- mail_get_folder(uri, 0, emfv_got_folder, emfv, mail_thread_queued);
+ mail_get_folder(uri, 0, emfv_got_folder, emfv, mail_msg_fast_ordered_push);
}
-
+
static void
-@@ -1752,7 +1753,7 @@ filter_type_uid (CamelFolder *folder, co
+@@ -1885,7 +1886,7 @@ filter_type_uid (CamelFolder *folder, co
data->type = type;
data->source = source;
-
+
- mail_get_message (folder, uid, filter_type_got_message, data, mail_thread_new);
+ mail_get_message (folder, uid, filter_type_got_message, data, mail_msg_unordered_push);
}
-
+
static void
-@@ -1850,7 +1851,7 @@ vfolder_type_uid (CamelFolder *folder, c
+@@ -1983,7 +1984,7 @@ vfolder_type_uid (CamelFolder *folder, c
data->type = type;
data->uri = g_strdup (uri);
-
+
- mail_get_message (folder, uid, vfolder_type_got_message, data, mail_thread_new);
+ mail_get_message (folder, uid, vfolder_type_got_message, data, mail_msg_unordered_push);
}
-
+
static void
-@@ -2427,7 +2428,7 @@ emfv_message_selected_timeout(void *data
+@@ -2560,7 +2561,7 @@ emfv_message_selected_timeout(void *data
emfv->displayed_uid);
gtk_html_stream_close(hstream, GTK_HTML_STREAM_OK);
*/
@@ -4912,61 +4911,59 @@ diff -up evolution-2.21.1/mail/em-folder-view.c.kill-ethread evolution-2.21.1/ma
} else {
e_profile_event_emit("goto.empty", "", 0);
g_free(emfv->priv->selected_uid);
-diff -up evolution-2.21.1/mail/mail-session.c.kill-ethread evolution-2.21.1/mail/mail-session.c
---- evolution-2.21.1/mail/mail-session.c.kill-ethread 2007-10-23 06:06:27.000000000 -0400
-+++ evolution-2.21.1/mail/mail-session.c 2007-10-29 14:47:20.000000000 -0400
+diff -up evolution-2.21.4/mail/mail-session.c.kill-ethread evolution-2.21.4/mail/mail-session.c
+--- evolution-2.21.4/mail/mail-session.c.kill-ethread 2007-12-17 00:33:20.000000000 -0500
++++ evolution-2.21.4/mail/mail-session.c 2007-12-17 12:33:08.000000000 -0500
@@ -35,7 +35,7 @@
#include
-
+
#include
-#include
+#include
-
+
#include /* FIXME: this is where camel_init is defined, it shouldn't include everything else */
#include
-@@ -264,148 +264,145 @@ forget_password (CamelSession *session,
-
+@@ -265,21 +265,22 @@ forget_password (CamelSession *session,
+
/* ********************************************************************** */
-
+
-static GtkDialog *message_dialog;
-static EDList message_list = E_DLIST_INITIALISER(message_list);
+static gpointer user_message_dialog;
+static GQueue user_message_queue = { NULL, NULL, 0 };
-
+
struct _user_message_msg {
- struct _mail_msg msg;
+ MailMsg base;
-
+
CamelSessionAlertType type;
char *prompt;
+ EFlag *done;
-
+
unsigned int allow_cancel:1;
unsigned int result:1;
unsigned int ismain:1;
};
-
+
-static void do_user_message (struct _mail_msg *mm);
+static void user_message_exec (struct _user_message_msg *m);
-
+
/* clicked, send back the reply */
static void
- user_message_response (GtkDialog *dialog, int button, struct _user_message_msg *m)
+@@ -287,126 +288,122 @@ user_message_response (GtkDialog *dialog
{
gtk_widget_destroy ((GtkWidget *) dialog);
--
+
- message_dialog = NULL;
--
-+
+ user_message_dialog = NULL;
-+
+
/* if !allow_cancel, then we've already replied */
if (m->allow_cancel) {
m->result = button == GTK_RESPONSE_OK;
- e_msgport_reply((EMsg *)m);
+ e_flag_set (m->done);
}
-
+
/* check for pendings */
- if ((m = (struct _user_message_msg *)e_dlist_remhead(&message_list)))
- do_user_message((struct _mail_msg *)m);
@@ -4982,7 +4979,7 @@ diff -up evolution-2.21.1/mail/mail-session.c.kill-ethread evolution-2.21.1/mail
+ mail_msg_unref (m);
+ }
}
-
+
-/* This is kinda ugly/inefficient, but oh well, it works */
-static const char *error_type[] = {
- "mail:session-message-info", "mail:session-message-warning", "mail:session-message-error",
@@ -4996,14 +4993,14 @@ diff -up evolution-2.21.1/mail/mail-session.c.kill-ethread evolution-2.21.1/mail
- struct _user_message_msg *m = (struct _user_message_msg *)mm;
- int type;
+ const gchar *error_type;
-
+
- if (!m->ismain && message_dialog != NULL) {
- e_dlist_addtail (&message_list, (EDListNode *)m);
+ if (!m->ismain && user_message_dialog != NULL) {
+ g_queue_push_tail (&user_message_queue, mail_msg_ref (m));
return;
}
-
+
switch (m->type) {
- case CAMEL_SESSION_ALERT_INFO:
- type = 0;
@@ -5072,7 +5069,7 @@ diff -up evolution-2.21.1/mail/mail-session.c.kill-ethread evolution-2.21.1/mail
+ gtk_widget_show (user_message_dialog);
}
}
-
+
static void
-free_user_message(struct _mail_msg *mm)
+user_message_free (struct _user_message_msg *m)
@@ -5082,7 +5079,7 @@ diff -up evolution-2.21.1/mail/mail-session.c.kill-ethread evolution-2.21.1/mail
g_free(m->prompt);
+ e_flag_free(m->done);
}
-
+
-static struct _mail_msg_op user_message_op = { NULL, do_user_message, NULL, free_user_message };
+static MailMsgInfo user_message_info = {
+ sizeof (struct _user_message_msg),
@@ -5091,7 +5088,7 @@ diff -up evolution-2.21.1/mail/mail-session.c.kill-ethread evolution-2.21.1/mail
+ (MailMsgDoneFunc) NULL,
+ (MailMsgFreeFunc) user_message_free
+};
-
+
static gboolean
alert_user(CamelSession *session, CamelSessionAlertType type, const char *prompt, gboolean cancel)
{
@@ -5101,10 +5098,10 @@ diff -up evolution-2.21.1/mail/mail-session.c.kill-ethread evolution-2.21.1/mail
- gboolean ret;
+ struct _user_message_msg *m;
+ gboolean result = TRUE;
-
+
if (!mail_session->interactive)
return FALSE;
-
+
- if (cancel)
- user_message_reply = e_msgport_new ();
- m = mail_msg_new (&user_message_op, user_message_reply, sizeof (*m));
@@ -5116,21 +5113,21 @@ diff -up evolution-2.21.1/mail/mail-session.c.kill-ethread evolution-2.21.1/mail
+ m->prompt = g_strdup (prompt);
+ m->done = e_flag_new ();
m->allow_cancel = cancel;
-
+
- if (m->ismain)
- do_user_message((struct _mail_msg *)m);
- else {
- extern EMsgPort *mail_gui_port2;
+ if (cancel)
+ mail_msg_ref (m);
-
+
- e_msgport_put(mail_gui_port2, (EMsg *)m);
- }
+ if (m->ismain)
+ user_message_exec (m);
+ else
+ mail_msg_main_loop_push (m);
-
+
if (cancel) {
- r = (struct _user_message_msg *)e_msgport_wait(user_message_reply);
- g_return_val_if_fail (m == r, FALSE);
@@ -5138,7 +5135,7 @@ diff -up evolution-2.21.1/mail/mail-session.c.kill-ethread evolution-2.21.1/mail
+ result = m->result;
+ mail_msg_unref (m);
+ }
-
+
- ret = m->result;
- mail_msg_free(m);
- e_msgport_destroy(user_message_reply);
@@ -5148,50 +5145,50 @@ diff -up evolution-2.21.1/mail/mail-session.c.kill-ethread evolution-2.21.1/mail
+ user_message_free (m);
+ mail_msg_unref (m);
+ }
-
+
- return ret;
+ return result;
}
-
+
static CamelFolder *
-@@ -541,7 +538,7 @@ get_filter_driver (CamelSession *session
+@@ -542,7 +539,7 @@ get_filter_driver (CamelSession *session
/* TODO: This is very temporary, until we have a better way to do the progress reporting,
we just borrow a dummy mail-mt thread message and hook it onto out camel thread message */
-
+
-static mail_msg_op_t ms_thread_ops_dummy = { NULL };
+static MailMsgInfo ms_thread_info_dummy = { sizeof (MailMsg) };
-
+
static void *ms_thread_msg_new(CamelSession *session, CamelSessionThreadOps *ops, unsigned int size)
{
-@@ -550,7 +547,7 @@ static void *ms_thread_msg_new(CamelSess
+@@ -551,7 +548,7 @@ static void *ms_thread_msg_new(CamelSess
/* We create a dummy mail_msg, and then copy its cancellation port over to ours, so
we get cancellation and progress in common with hte existing mail code, for free */
if (msg) {
- struct _mail_msg *m = mail_msg_new(&ms_thread_ops_dummy, NULL, sizeof(struct _mail_msg));
+ MailMsg *m = mail_msg_new(&ms_thread_info_dummy);
-
+
msg->data = m;
camel_operation_unref(msg->op);
-@@ -563,7 +560,7 @@ static void *ms_thread_msg_new(CamelSess
-
+@@ -564,7 +561,7 @@ static void *ms_thread_msg_new(CamelSess
+
static void ms_thread_msg_free(CamelSession *session, CamelSessionThreadMsg *m)
{
- mail_msg_free(m->data);
+ mail_msg_unref(m->data);
ms_parent_class->thread_msg_free(session, m);
}
-
-@@ -686,22 +683,23 @@ mail_session_set_interactive (gboolean i
+
+@@ -689,22 +686,23 @@ mail_session_set_interactive (gboolean i
MAIL_SESSION (session)->interactive = interactive;
-
+
if (!interactive) {
- struct _user_message_msg *um;
+ struct _user_message_msg *msg;
-
+
d(printf ("Gone non-interactive, checking for outstanding interactive tasks\n"));
-
+
e_passwords_cancel();
-
+
/* flush/cancel pending user messages */
- while ((um = (struct _user_message_msg *) e_dlist_remhead (&message_list))) {
- d(printf ("Flusing message request: %s\n", um->prompt));
@@ -5201,7 +5198,7 @@ diff -up evolution-2.21.1/mail/mail-session.c.kill-ethread evolution-2.21.1/mail
+ e_flag_set (msg->done);
+ mail_msg_unref (msg);
}
-
+
/* and the current */
- if (message_dialog) {
+ if (user_message_dialog) {
@@ -5211,56 +5208,61 @@ diff -up evolution-2.21.1/mail/mail-session.c.kill-ethread evolution-2.21.1/mail
}
}
}
-diff -up evolution-2.21.1/mail/mail-mt.c.kill-ethread evolution-2.21.1/mail/mail-mt.c
---- evolution-2.21.1/mail/mail-mt.c.kill-ethread 2007-10-23 06:06:27.000000000 -0400
-+++ evolution-2.21.1/mail/mail-mt.c 2007-10-29 14:47:20.000000000 -0400
+diff -up evolution-2.21.4/mail/mail-mt.c.kill-ethread evolution-2.21.4/mail/mail-mt.c
+--- evolution-2.21.4/mail/mail-mt.c.kill-ethread 2007-12-17 00:52:03.000000000 -0500
++++ evolution-2.21.4/mail/mail-mt.c 2007-12-17 12:33:08.000000000 -0500
@@ -29,8 +29,8 @@
#include
#include
-
+
-#include
#include
+#include
-
+
#include
#include
@@ -63,7 +63,7 @@ static void mail_operation_status(struct
#endif
-
+
/* background operation status stuff */
-struct _mail_msg_priv {
+struct _MailMsgPrivate {
int activity_state; /* sigh sigh sigh, we need to keep track of the state external to the
pointer itself for locking/race conditions */
int activity_id;
-@@ -82,15 +82,12 @@ static GHashTable *mail_msg_active_table
+@@ -84,20 +84,12 @@ static GHashTable *mail_msg_active_table
static pthread_mutex_t mail_msg_lock = PTHREAD_MUTEX_INITIALIZER;
static pthread_cond_t mail_msg_cond = PTHREAD_COND_INITIALIZER;
-
+
-pthread_t mail_gui_thread;
-
MailAsyncEvent *mail_async_event;
-
+
-static void mail_msg_destroy(EThread *e, EMsg *msg, void *data);
-
+-void mail_msg_set_cancelable (struct _mail_msg *msg, gboolean status)
+-{
+- msg->priv->cancelable = status;
+-}
+-
-void *mail_msg_new(mail_msg_op_t *ops, EMsgPort *reply_port, size_t size)
+gpointer
+mail_msg_new (MailMsgInfo *info)
{
- struct _mail_msg *msg;
+ MailMsg *msg;
-
+
MAIL_MT_LOCK(mail_msg_lock);
-
-@@ -112,7 +109,6 @@ void *mail_msg_new(mail_msg_op_t *ops, E
+
+@@ -119,7 +111,6 @@ void *mail_msg_new(mail_msg_op_t *ops, E
fprintf(log, "Logging async operations\n");
-
+
if (log_locks) {
- fprintf(log, "Logging lock operations, mail_gui_thread = %" G_GINT64_MODIFIER "x\n\n", e_util_pthread_id(mail_gui_thread));
fprintf(log, "%" G_GINT64_MODIFIER "x: lock mail_msg_lock\n", e_util_pthread_id(pthread_self()));
}
} else {
-@@ -122,13 +118,13 @@ void *mail_msg_new(mail_msg_op_t *ops, E
+@@ -129,13 +120,13 @@ void *mail_msg_new(mail_msg_op_t *ops, E
}
}
#endif
@@ -5275,41 +5277,44 @@ diff -up evolution-2.21.1/mail/mail-mt.c.kill-ethread evolution-2.21.1/mail/mail
camel_exception_init(&msg->ex);
- msg->priv = g_malloc0(sizeof(*msg->priv));
+ msg->priv = g_slice_new0 (MailMsgPrivate);
-
+ msg->priv->cancelable = TRUE;
+
g_hash_table_insert(mail_msg_active_table, GINT_TO_POINTER(msg->seq), msg);
-
-@@ -143,12 +139,15 @@ void *mail_msg_new(mail_msg_op_t *ops, E
+@@ -151,18 +142,20 @@ void *mail_msg_new(mail_msg_op_t *ops, E
return msg;
}
-
+
-
--static void end_event_callback (CamelObject *o, void *event_data, void *data)
+-static void end_event_callback (CamelObject *o, void *event_data, void *error)
+static void
-+end_event_callback (CamelObject *o, void *event_data, void *data)
++end_event_callback (CamelObject *o, void *event_data, void *data, void *error)
{
- EActivityHandler *activity_handler = mail_component_peek_activity_handler (mail_component_peek ());
+ MailComponent *component;
+ EActivityHandler *activity_handler;
guint activity_id = GPOINTER_TO_INT (event_data);
-
+
+ component = mail_component_peek ();
+ activity_handler = mail_component_peek_activity_handler (component);
- e_activity_handler_operation_finished (activity_handler, activity_id);
+ if (!error) {
+ e_activity_handler_operation_finished (activity_handler, activity_id);
+ } else {
+ d(printf("Yahooooo, we got it nonintrusively\n"));
+ e_activity_handler_operation_set_error (activity_handler, activity_id, error);
+-
+ }
}
-
-@@ -177,58 +176,93 @@ checkmem(void *p)
+
+@@ -191,43 +184,81 @@ checkmem(void *p)
}
#endif
-
+
-void mail_msg_free(void *msg)
+static void
+mail_msg_free (MailMsg *mail_msg)
{
- struct _mail_msg *m = msg;
- int activity_id;
-+ /* XXX This function is broken out from mail_msg_unref()
-+ * only for the benefit of op_status_exec() below. */
-+
+ if (mail_msg->cancel != NULL) {
+ camel_operation_mute (mail_msg->cancel);
+ camel_operation_unref (mail_msg->cancel);
@@ -5337,13 +5342,14 @@ diff -up evolution-2.21.1/mail/mail-mt.c.kill-ethread evolution-2.21.1/mail/mail
+{
+ MailMsg *mail_msg = msg;
+ gint activity_id;
-+
+ GtkWidget *error = NULL;
+
+ g_return_if_fail (mail_msg != NULL);
+ g_return_if_fail (mail_msg->ref_count > 0);
+
+ if (g_atomic_int_exchange_and_add (&mail_msg->ref_count, -1) > 1)
+ return;
-
++
#ifdef MALLOC_CHECK
- checkmem(m);
- checkmem(m->cancel);
@@ -5353,14 +5359,14 @@ diff -up evolution-2.21.1/mail/mail-mt.c.kill-ethread evolution-2.21.1/mail/mail
+ checkmem(mail_msg->priv);
#endif
d(printf("Free message %p\n", msg));
-
+
- if (m->ops->destroy_msg)
- m->ops->destroy_msg(m);
+ if (mail_msg->info->free)
+ mail_msg->info->free(mail_msg);
-
+
MAIL_MT_LOCK(mail_msg_lock);
-
+
#ifdef LOG_OPS
- if (log_ops)
- fprintf(log, "%p: Free (exception `%s')\n", msg,
@@ -5379,7 +5385,7 @@ diff -up evolution-2.21.1/mail/mail-mt.c.kill-ethread evolution-2.21.1/mail/mail
+ g_hash_table_remove (
+ mail_msg_active_table, GINT_TO_POINTER (mail_msg->seq));
+ pthread_cond_broadcast (&mail_msg_cond);
-
+
/* We need to make sure we dont lose a reference here YUCK YUCK */
/* This is tightly integrated with the code in do_op_status,
as it closely relates to the CamelOperation setup in msg_new() above */
@@ -5393,11 +5399,16 @@ diff -up evolution-2.21.1/mail/mail-mt.c.kill-ethread evolution-2.21.1/mail/mail
return;
} else {
- activity_id = m->priv->activity_id;
+- error = m->priv->error;
+ activity_id = mail_msg->priv->activity_id;
- }
-
++ error = mail_msg->priv->error;
+ if (error && !activity_id) {
+ e_activity_handler_make_error (mail_component_peek_activity_handler (mail_component_peek ()), "mail",
+ g_object_get_data ((GObject *) error, "primary"), error);
+@@ -238,19 +269,13 @@ void mail_msg_free(void *msg)
+
MAIL_MT_UNLOCK(mail_msg_lock);
-
+
- if (m->cancel) {
- camel_operation_mute(m->cancel);
- camel_operation_unref(m->cancel);
@@ -5408,21 +5419,21 @@ diff -up evolution-2.21.1/mail/mail-mt.c.kill-ethread evolution-2.21.1/mail/mail
- g_free(m->priv);
- g_free(m);
+ mail_msg_free (mail_msg);
-
+
if (activity_id != 0)
- mail_async_event_emit(mail_async_event, MAIL_ASYNC_GUI, (MailAsyncFunc) end_event_callback,
-- NULL, GINT_TO_POINTER (activity_id), NULL);
+- NULL, GINT_TO_POINTER (activity_id), error);
+ mail_async_event_emit (
+ mail_async_event, MAIL_ASYNC_GUI,
+ (MailAsyncFunc) end_event_callback,
-+ NULL, GINT_TO_POINTER (activity_id), NULL);
++ NULL, GINT_TO_POINTER (activity_id), error);
}
-
+
/* hash table of ops->dialogue of active errors */
-@@ -244,9 +278,10 @@ static void error_response(GtkObject *o,
+@@ -266,9 +291,10 @@ static void error_response(GtkObject *o,
gtk_widget_destroy((GtkWidget *)o);
}
-
+
-void mail_msg_check_error(void *msg)
+void
+mail_msg_check_error (gpointer msg)
@@ -5431,8 +5442,8 @@ diff -up evolution-2.21.1/mail/mail-mt.c.kill-ethread evolution-2.21.1/mail/mail
+ MailMsg *m = msg;
char *what;
GtkDialog *gd;
-
-@@ -271,27 +306,27 @@ void mail_msg_check_error(void *msg)
+
+@@ -293,21 +319,21 @@ void mail_msg_check_error(void *msg)
/* check to see if we have dialogue already running for this operation */
/* we key on the operation pointer, which is at least accurate enough
for the operation type, although it could be on a different object. */
@@ -5441,7 +5452,7 @@ diff -up evolution-2.21.1/mail/mail-mt.c.kill-ethread evolution-2.21.1/mail/mail
g_warning("Error occurred while existing dialogue active:\n%s", camel_exception_get_description(&m->ex));
return;
}
-
+
- if (m->ops->describe_msg
- && (what = m->ops->describe_msg(m, FALSE))) {
+ if (m->info->desc
@@ -5450,26 +5461,28 @@ diff -up evolution-2.21.1/mail/mail-mt.c.kill-ethread evolution-2.21.1/mail/mail
g_free(what);
} else
gd = (GtkDialog *)e_error_new(NULL, "mail:async-error-nodescribe", camel_exception_get_description(&m->ex), NULL);
-
+
- g_hash_table_insert(active_errors, m->ops, gd);
- g_signal_connect(gd, "response", G_CALLBACK(error_response), m->ops);
- g_signal_connect(gd, "destroy", G_CALLBACK(error_destroy), m->ops);
+ g_hash_table_insert(active_errors, m->info, gd);
+ g_signal_connect(gd, "response", G_CALLBACK(error_response), m->info);
+ g_signal_connect(gd, "destroy", G_CALLBACK(error_destroy), m->info);
- gtk_widget_show((GtkWidget *)gd);
- }
-
+ if (m->priv->cancelable)
+ m->priv->error = (GtkWidget *) gd;
+ else
+@@ -316,7 +342,7 @@ void mail_msg_check_error(void *msg)
+
void mail_msg_cancel(unsigned int msgid)
{
- struct _mail_msg *m;
+ MailMsg *m;
-
+
MAIL_MT_LOCK(mail_msg_lock);
m = g_hash_table_lookup(mail_msg_active_table, GINT_TO_POINTER(msgid));
-@@ -304,13 +339,12 @@ void mail_msg_cancel(unsigned int msgid)
-
-
+@@ -329,13 +355,12 @@ void mail_msg_cancel(unsigned int msgid)
+
+
/* waits for a message to be finished processing (freed)
- the messageid is from struct _mail_msg->seq */
+ the messageid is from MailMsg->seq */
@@ -5478,14 +5491,14 @@ diff -up evolution-2.21.1/mail/mail-mt.c.kill-ethread evolution-2.21.1/mail/mail
- struct _mail_msg *m;
- int ismain = pthread_equal(pthread_self(), mail_gui_thread);
+ MailMsg *m;
-
+
- if (ismain) {
+ if (mail_in_main_thread ()) {
MAIL_MT_LOCK(mail_msg_lock);
m = g_hash_table_lookup(mail_msg_active_table, GINT_TO_POINTER(msgid));
while (m) {
-@@ -347,9 +381,7 @@ int mail_msg_active(unsigned int msgid)
-
+@@ -372,9 +397,7 @@ int mail_msg_active(unsigned int msgid)
+
void mail_msg_wait_all(void)
{
- int ismain = pthread_equal(pthread_self(), mail_gui_thread);
@@ -5495,70 +5508,81 @@ diff -up evolution-2.21.1/mail/mail-mt.c.kill-ethread evolution-2.21.1/mail/mail
MAIL_MT_LOCK(mail_msg_lock);
while (g_hash_table_size(mail_msg_active_table) > 0) {
MAIL_MT_UNLOCK(mail_msg_lock);
-@@ -367,294 +399,239 @@ void mail_msg_wait_all(void)
+@@ -392,294 +415,247 @@ void mail_msg_wait_all(void)
}
-
+
/* **************************************** */
-struct _cancel_hook_data {
- struct _cancel_hook_data *next;
- struct _cancel_hook_data *prev;
-
+-
- GDestroyNotify func;
- void *data;
-};
-+static GHookList cancel_hook_list;
-
+
-static EDList cancel_hook_list = E_DLIST_INITIALISER(cancel_hook_list);
--
++static GHookList cancel_hook_list;
+
-void *mail_cancel_hook_add(GDestroyNotify func, void *data)
+GHook *
+mail_cancel_hook_add (GHookFunc func, gpointer data)
{
- struct _cancel_hook_data *d;
+ GHook *hook;
-
+
- d = g_malloc0(sizeof(*d));
- d->func = func;
- d->data = data;
+ MAIL_MT_LOCK (mail_msg_lock);
-
+
- MAIL_MT_LOCK(mail_msg_lock);
- e_dlist_addtail(&cancel_hook_list, (EDListNode *)d);
- MAIL_MT_UNLOCK(mail_msg_lock);
+ if (!cancel_hook_list.is_setup)
+ g_hook_list_init (&cancel_hook_list, sizeof (GHook));
-
+
- return (void *)d;
--}
+ hook = g_hook_alloc (&cancel_hook_list);
+ hook->func = func;
+ hook->data = data;
-
++
++ g_hook_append (&cancel_hook_list, hook);
++
++ MAIL_MT_UNLOCK (mail_msg_lock);
++
++ return hook;
+ }
+
-void mail_cancel_hook_remove(void *handle)
--{
++void
++mail_cancel_hook_remove (GHook *hook)
+ {
- struct _cancel_hook_data *d = handle;
-+ g_hook_append (&cancel_hook_list, hook);
-
++ MAIL_MT_LOCK (mail_msg_lock);
+
- MAIL_MT_LOCK(mail_msg_lock);
- e_dlist_remove((EDListNode *)d);
- MAIL_MT_UNLOCK(mail_msg_lock);
- g_free(d);
-+ MAIL_MT_UNLOCK (mail_msg_lock);
++ g_assert (cancel_hook_list.is_setup);
++ g_hook_destroy_link (&cancel_hook_list, hook);
+
-+ return hook;
++ MAIL_MT_UNLOCK (mail_msg_lock);
}
-
+
-void mail_cancel_all(void)
+void
-+mail_cancel_hook_remove (GHook *hook)
++mail_cancel_all (void)
{
- struct _cancel_hook_data *d, *n;
++ camel_operation_cancel (NULL);
++
+ MAIL_MT_LOCK (mail_msg_lock);
-
+
- camel_operation_cancel(NULL);
-+ g_assert (cancel_hook_list.is_setup);
-+ g_hook_destroy_link (&cancel_hook_list, hook);
-
++ if (cancel_hook_list.is_setup)
++ g_hook_list_invoke (&cancel_hook_list, FALSE);
+
- /* I can ssee a deadlock coming on ... */
- MAIL_MT_LOCK(mail_msg_lock);
- d = (struct _cancel_hook_data *)cancel_hook_list.head;
@@ -5571,7 +5595,7 @@ diff -up evolution-2.21.1/mail/mail-mt.c.kill-ethread evolution-2.21.1/mail/mail
- MAIL_MT_UNLOCK(mail_msg_lock);
+ MAIL_MT_UNLOCK (mail_msg_lock);
}
-
+
-EMsgPort *mail_gui_port;
-static GIOChannel *mail_gui_channel;
-static guint mail_gui_watch;
@@ -5597,17 +5621,12 @@ diff -up evolution-2.21.1/mail/mail-mt.c.kill-ethread evolution-2.21.1/mail/mail
-EThread *
-mail_win32_get_mail_thread_queued (void)
+void
-+mail_cancel_all (void)
++mail_msg_set_cancelable (gpointer msg, gboolean status)
{
- return mail_thread_queued;
-+ camel_operation_cancel (NULL);
-+
-+ MAIL_MT_LOCK (mail_msg_lock);
-+
-+ if (cancel_hook_list.is_setup)
-+ g_hook_list_invoke (&cancel_hook_list, FALSE);
++ MailMsg *mail_msg = msg;
+
-+ MAIL_MT_UNLOCK (mail_msg_lock);
++ mail_msg->priv->cancelable = status;
}
-#endif
+
@@ -5616,7 +5635,7 @@ diff -up evolution-2.21.1/mail/mail-mt.c.kill-ethread evolution-2.21.1/mail/mail
+static GAsyncQueue *main_loop_queue = NULL;
+static GAsyncQueue *msg_reply_queue = NULL;
+static GThread *main_thread = NULL;
-
+
static gboolean
-mail_msgport_replied(GIOChannel *source, GIOCondition cond, void *d)
+mail_msg_idle_cb (void)
@@ -5624,11 +5643,11 @@ diff -up evolution-2.21.1/mail/mail-mt.c.kill-ethread evolution-2.21.1/mail/mail
- EMsgPort *port = (EMsgPort *)d;
- mail_msg_t *m;
+ MailMsg *msg;
-
+
- while (( m = (mail_msg_t *)e_msgport_get(port))) {
+ g_assert (main_loop_queue != NULL);
+ g_assert (msg_reply_queue != NULL);
-
+
-#ifdef MALLOC_CHECK
- checkmem(m);
- checkmem(m->cancel);
@@ -5665,11 +5684,11 @@ diff -up evolution-2.21.1/mail/mail-mt.c.kill-ethread evolution-2.21.1/mail/mail
+ mail_msg_check_error (msg);
+ mail_msg_unref (msg);
}
-
+
- return TRUE;
+ return FALSE;
}
-
+
-static gboolean
-mail_msgport_received(GIOChannel *source, GIOCondition cond, void *d)
+static void
@@ -5720,7 +5739,7 @@ diff -up evolution-2.21.1/mail/mail-mt.c.kill-ethread evolution-2.21.1/mail/mail
+ msg->cancel = NULL;
+ MAIL_MT_UNLOCK (mail_msg_lock);
}
-
+
- return TRUE;
+ g_async_queue_push (msg_reply_queue, msg);
+
@@ -5730,7 +5749,7 @@ diff -up evolution-2.21.1/mail/mail-mt.c.kill-ethread evolution-2.21.1/mail/mail
+ (GSourceFunc) mail_msg_idle_cb, NULL);
+ G_UNLOCK (idle_source_id);
}
-
+
-/* Test code, lighterwight, more configurable calls */
-static gboolean
-mail_msgport_received2(GIOChannel *source, GIOCondition cond, void *d)
@@ -5740,7 +5759,7 @@ diff -up evolution-2.21.1/mail/mail-mt.c.kill-ethread evolution-2.21.1/mail/mail
- EMsgPort *port = (EMsgPort *)d;
- mail_msg_t *m;
+ mail_msg_wait_all();
-
+
- while (( m = (mail_msg_t *)e_msgport_get(port))) {
-#ifdef LOG_OPS
- if (log_ops)
@@ -5749,7 +5768,7 @@ diff -up evolution-2.21.1/mail/mail-mt.c.kill-ethread evolution-2.21.1/mail/mail
+ G_LOCK (idle_source_id);
+ if (idle_source_id != 0) {
+ GSource *source;
-
+
- if (m->ops->receive_msg)
- m->ops->receive_msg(m);
- else
@@ -5762,18 +5781,18 @@ diff -up evolution-2.21.1/mail/mail-mt.c.kill-ethread evolution-2.21.1/mail/mail
+ idle_source_id = 0;
}
+ G_UNLOCK (idle_source_id);
-
+
- return TRUE;
-}
+ g_assert (main_loop_queue != NULL);
+ g_async_queue_unref (main_loop_queue);
+ main_loop_queue = NULL;
-
+
+ g_assert (msg_reply_queue != NULL);
+ g_async_queue_unref (msg_reply_queue);
+ msg_reply_queue = NULL;
+}
-
+
-static void
-mail_msg_destroy(EThread *e, EMsg *msg, void *data)
+void
@@ -5782,7 +5801,7 @@ diff -up evolution-2.21.1/mail/mail-mt.c.kill-ethread evolution-2.21.1/mail/mail
- mail_msg_t *m = (mail_msg_t *)msg;
+ main_loop_queue = g_async_queue_new ();
+ msg_reply_queue = g_async_queue_new ();
-
+
-#ifdef MALLOC_CHECK
- checkmem(m);
- checkmem(m->cancel);
@@ -5790,38 +5809,38 @@ diff -up evolution-2.21.1/mail/mail-mt.c.kill-ethread evolution-2.21.1/mail/mail
-#endif
+ mail_msg_active_table = g_hash_table_new (NULL, NULL);
+ main_thread = g_thread_self ();
-
+
- mail_msg_free(m);
+ mail_async_event = mail_async_event_new ();
}
-
+
-static void
-mail_msg_received(EThread *e, EMsg *msg, void *data)
+static gint
+mail_msg_compare (const MailMsg *msg1, const MailMsg *msg2)
{
- mail_msg_t *m = (mail_msg_t *)msg;
-+ gint priority1 = msg1->priority;
-+ gint priority2 = msg2->priority;
-
+-
-#ifdef MALLOC_CHECK
- checkmem(m);
- checkmem(m->cancel);
- checkmem(m->priv);
-#endif
-+ if (priority1 == priority2)
-+ return 0;
-
++ gint priority1 = msg1->priority;
++ gint priority2 = msg2->priority;
+
- if (m->ops->describe_msg) {
- char *text = m->ops->describe_msg(m, FALSE);
--
++ if (priority1 == priority2)
++ return 0;
+
-#ifdef LOG_OPS
- if (log_ops)
- fprintf(log, "%p: Received at thread %" G_GINT64_MODIFIER "x: '%s'\n", m, e_util_pthread_id(pthread_self()), text);
-#endif
+ return (priority1 < priority2) ? 1 : -1;
+}
-
+
- d(printf("message received at thread\n"));
- camel_operation_register(m->cancel);
- camel_operation_start(m->cancel, "%s", text);
@@ -5837,7 +5856,7 @@ diff -up evolution-2.21.1/mail/mail-mt.c.kill-ethread evolution-2.21.1/mail/mail
+{
+ GThreadPool *thread_pool;
+ gint max_threads = GPOINTER_TO_INT (data);
-
+
- if (m->ops->receive_msg) {
- mail_enable_stop();
- m->ops->receive_msg(m);
@@ -5848,7 +5867,7 @@ diff -up evolution-2.21.1/mail/mail-mt.c.kill-ethread evolution-2.21.1/mail/mail
+ (GFunc) mail_msg_proxy, NULL, max_threads, FALSE, NULL);
+ g_thread_pool_set_sort_function (
+ thread_pool, (GCompareDataFunc) mail_msg_compare, NULL);
-
+
- if (m->ops->describe_msg) {
- camel_operation_end(m->cancel);
- camel_operation_unregister(m->cancel);
@@ -5859,7 +5878,7 @@ diff -up evolution-2.21.1/mail/mail-mt.c.kill-ethread evolution-2.21.1/mail/mail
- }
+ return thread_pool;
}
-
+
-void mail_msg_cleanup(void)
+void
+mail_msg_main_loop_push (gpointer msg)
@@ -5867,7 +5886,7 @@ diff -up evolution-2.21.1/mail/mail-mt.c.kill-ethread evolution-2.21.1/mail/mail
- mail_msg_wait_all();
+ g_async_queue_push_sorted (main_loop_queue, msg,
+ (GCompareDataFunc) mail_msg_compare, NULL);
-
+
- e_thread_destroy(mail_thread_queued_slow);
- e_thread_destroy(mail_thread_queued);
- e_thread_destroy(mail_thread_new);
@@ -5877,21 +5896,21 @@ diff -up evolution-2.21.1/mail/mail-mt.c.kill-ethread evolution-2.21.1/mail/mail
+ (GSourceFunc) mail_msg_idle_cb, NULL);
+ G_UNLOCK (idle_source_id);
+}
-
-- g_io_channel_unref(mail_gui_channel);
-- g_io_channel_unref(mail_gui_reply_channel);
++
+void
+mail_msg_unordered_push (gpointer msg)
+{
+ static GOnce once = G_ONCE_INIT;
-+
+
+- g_io_channel_unref(mail_gui_channel);
+- g_io_channel_unref(mail_gui_reply_channel);
+ g_once (&once, (GThreadFunc) create_thread_pool, GINT_TO_POINTER (10));
-
+
- e_msgport_destroy(mail_gui_port);
- e_msgport_destroy(mail_gui_reply_port);
+ g_thread_pool_push ((GThreadPool *) once.retval, msg, NULL);
}
-
+
-static guint
-em_channel_setup(EMsgPort **port, GIOChannel **channel, GIOFunc func)
+void
@@ -5900,7 +5919,7 @@ diff -up evolution-2.21.1/mail/mail-mt.c.kill-ethread evolution-2.21.1/mail/mail
- GSource *source;
- guint id;
+ static GOnce once = G_ONCE_INIT;
-
+
- *port = e_msgport_new();
-#ifndef G_OS_WIN32
- *channel = g_io_channel_unix_new(e_msgport_fd(*port));
@@ -5913,11 +5932,11 @@ diff -up evolution-2.21.1/mail/mail-mt.c.kill-ethread evolution-2.21.1/mail/mail
- id = g_source_attach(source, NULL);
- g_source_unref(source);
+ g_once (&once, (GThreadFunc) create_thread_pool, GINT_TO_POINTER (1));
-
+
- return id;
+ g_thread_pool_push ((GThreadPool *) once.retval, msg, NULL);
}
-
+
-void mail_msg_init(void)
+void
+mail_msg_slow_ordered_push (gpointer msg)
@@ -5942,35 +5961,35 @@ diff -up evolution-2.21.1/mail/mail-mt.c.kill-ethread evolution-2.21.1/mail/mail
- e_thread_set_reply_port(mail_thread_new, mail_gui_reply_port);
- e_thread_set_queue_limit(mail_thread_new, 10);
+ static GOnce once = G_ONCE_INIT;
-
+
- mail_msg_active_table = g_hash_table_new(NULL, NULL);
- mail_gui_thread = pthread_self();
+ g_once (&once, (GThreadFunc) create_thread_pool, GINT_TO_POINTER (1));
+
+ g_thread_pool_push ((GThreadPool *) once.retval, msg, NULL);
+}
-
+
- mail_async_event = mail_async_event_new();
+gboolean
+mail_in_main_thread (void)
+{
+ return (g_thread_self () == main_thread);
}
-
+
/* ********************************************************************** */
-@@ -665,7 +642,8 @@ static pthread_mutex_t status_lock = PTH
+@@ -690,7 +666,8 @@ static pthread_mutex_t status_lock = PTH
/* ********************************************************************** */
-
+
struct _proxy_msg {
- struct _mail_msg msg;
+ MailMsg base;
+
MailAsyncEvent *ea;
mail_async_event_t type;
-
-@@ -679,10 +657,8 @@ struct _proxy_msg {
+
+@@ -704,10 +681,8 @@ struct _proxy_msg {
};
-
+
static void
-do_async_event(struct _mail_msg *mm)
+do_async_event(struct _proxy_msg *m)
@@ -5980,16 +5999,16 @@ diff -up evolution-2.21.1/mail/mail-mt.c.kill-ethread evolution-2.21.1/mail/mail
m->thread = pthread_self();
m->have_thread = TRUE;
m->func(m->o, m->event_data, m->data);
-@@ -697,16 +673,17 @@ static int
+@@ -722,16 +697,17 @@ static int
idle_async_event(void *mm)
{
do_async_event(mm);
- mail_msg_free(mm);
+ mail_msg_unref(mm);
-
+
return FALSE;
}
-
+
-static struct _mail_msg_op async_event_op = {
- NULL,
- do_async_event,
@@ -6002,30 +6021,30 @@ diff -up evolution-2.21.1/mail/mail-mt.c.kill-ethread evolution-2.21.1/mail/mail
+ (MailMsgDoneFunc) NULL,
+ (MailMsgFreeFunc) NULL
};
-
+
MailAsyncEvent *mail_async_event_new(void)
-@@ -723,10 +700,9 @@ int mail_async_event_emit(MailAsyncEvent
+@@ -748,10 +724,9 @@ int mail_async_event_emit(MailAsyncEvent
{
struct _proxy_msg *m;
int id;
- int ismain = pthread_equal(pthread_self(), mail_gui_thread);
-
+
/* we dont have a reply port for this, we dont care when/if it gets executed, just queue it */
- m = mail_msg_new(&async_event_op, NULL, sizeof(*m));
+ m = mail_msg_new(&async_event_info);
m->func = func;
m->o = o;
m->event_data = event_data;
-@@ -735,7 +711,7 @@ int mail_async_event_emit(MailAsyncEvent
+@@ -760,7 +735,7 @@ int mail_async_event_emit(MailAsyncEvent
m->type = type;
m->have_thread = FALSE;
-
+
- id = m->msg.seq;
+ id = m->base.seq;
g_mutex_lock(ea->lock);
ea->tasks = g_slist_prepend(ea->tasks, m);
g_mutex_unlock(ea->lock);
-@@ -743,12 +719,12 @@ int mail_async_event_emit(MailAsyncEvent
+@@ -768,12 +743,12 @@ int mail_async_event_emit(MailAsyncEvent
/* We use an idle function instead of our own message port only because the
gui message ports's notification buffer might overflow and deadlock us */
if (type == MAIL_ASYNC_GUI) {
@@ -6038,10 +6057,10 @@ diff -up evolution-2.21.1/mail/mail-mt.c.kill-ethread evolution-2.21.1/mail/mail
} else
- e_thread_put(mail_thread_queued, (EMsg *)m);
+ mail_msg_fast_ordered_push (m);
-
+
return id;
}
-@@ -762,7 +738,7 @@ int mail_async_event_destroy(MailAsyncEv
+@@ -787,7 +762,7 @@ int mail_async_event_destroy(MailAsyncEv
g_mutex_lock(ea->lock);
while (ea->tasks) {
m = ea->tasks->data;
@@ -6050,9 +6069,9 @@ diff -up evolution-2.21.1/mail/mail-mt.c.kill-ethread evolution-2.21.1/mail/mail
if (m->have_thread && pthread_equal(m->thread, thread)) {
g_warning("Destroying async event from inside an event, returning EDEADLK");
g_mutex_unlock(ea->lock);
-@@ -784,17 +760,18 @@ int mail_async_event_destroy(MailAsyncEv
+@@ -809,17 +784,18 @@ int mail_async_event_destroy(MailAsyncEv
/* ********************************************************************** */
-
+
struct _call_msg {
- struct _mail_msg msg;
+ MailMsg base;
@@ -6063,7 +6082,7 @@ diff -up evolution-2.21.1/mail/mail-mt.c.kill-ethread evolution-2.21.1/mail/mail
va_list ap;
+ EFlag *done;
};
-
+
static void
-do_call(struct _mail_msg *mm)
+do_call(struct _call_msg *m)
@@ -6072,7 +6091,7 @@ diff -up evolution-2.21.1/mail/mail-mt.c.kill-ethread evolution-2.21.1/mail/mail
void *p1, *p2, *p3, *p4, *p5;
int i1;
va_list ap;
-@@ -842,45 +819,47 @@ do_call(struct _mail_msg *mm)
+@@ -867,45 +843,47 @@ do_call(struct _mail_msg *mm)
m->ret = m->func(p1, p2, i1, p3, p4, p5);
break;
}
@@ -6080,7 +6099,7 @@ diff -up evolution-2.21.1/mail/mail-mt.c.kill-ethread evolution-2.21.1/mail/mail
+ if (m->done != NULL)
+ e_flag_set (m->done);
}
-
+
-static struct _mail_msg_op mail_call_op = {
- NULL,
- do_call,
@@ -6093,7 +6112,7 @@ diff -up evolution-2.21.1/mail/mail-mt.c.kill-ethread evolution-2.21.1/mail/mail
+ (MailMsgDoneFunc) NULL,
+ (MailMsgFreeFunc) NULL
};
-
+
-void *mail_call_main(mail_call_t type, MailMainFunc func, ...)
+void *
+mail_call_main (mail_call_t type, MailMainFunc func, ...)
@@ -6103,9 +6122,9 @@ diff -up evolution-2.21.1/mail/mail-mt.c.kill-ethread evolution-2.21.1/mail/mail
va_list ap;
- EMsgPort *reply = NULL;
- int ismain = pthread_equal(pthread_self(), mail_gui_thread);
-
+
va_start(ap, func);
-
+
- if (!ismain)
- reply = e_msgport_new();
-
@@ -6114,7 +6133,7 @@ diff -up evolution-2.21.1/mail/mail-mt.c.kill-ethread evolution-2.21.1/mail/mail
m->type = type;
m->func = func;
G_VA_COPY(m->ap, ap);
-
+
- if (!ismain) {
- e_msgport_put(mail_gui_port, (EMsg *)m);
- e_msgport_wait(reply);
@@ -6130,26 +6149,26 @@ diff -up evolution-2.21.1/mail/mail-mt.c.kill-ethread evolution-2.21.1/mail/mail
+ e_flag_wait (m->done);
+ e_flag_free (m->done);
}
-
+
va_end(ap);
-
+
ret = m->ret;
- mail_msg_free(m);
+ mail_msg_unref (m);
-
+
return ret;
}
-@@ -889,40 +868,42 @@ void *mail_call_main(mail_call_t type, M
+@@ -914,40 +892,42 @@ void *mail_call_main(mail_call_t type, M
/* locked via status_lock */
static int busy_state;
-
+
-static void do_set_busy(struct _mail_msg *mm)
+static void
+do_set_busy(MailMsg *mm)
{
set_stop(busy_state > 0);
}
-
+
-static struct _mail_msg_op set_busy_op = {
- NULL,
- do_set_busy,
@@ -6162,12 +6181,12 @@ diff -up evolution-2.21.1/mail/mail-mt.c.kill-ethread evolution-2.21.1/mail/mail
+ (MailMsgDoneFunc) NULL,
+ (MailMsgFreeFunc) NULL
};
-
+
void mail_enable_stop(void)
{
- struct _mail_msg *m;
+ MailMsg *m;
-
+
MAIL_MT_LOCK(status_lock);
busy_state++;
if (busy_state == 1) {
@@ -6178,12 +6197,12 @@ diff -up evolution-2.21.1/mail/mail-mt.c.kill-ethread evolution-2.21.1/mail/mail
}
MAIL_MT_UNLOCK(status_lock);
}
-
+
void mail_disable_stop(void)
{
- struct _mail_msg *m;
+ MailMsg *m;
-
+
MAIL_MT_LOCK(status_lock);
busy_state--;
if (busy_state == 0) {
@@ -6194,19 +6213,19 @@ diff -up evolution-2.21.1/mail/mail-mt.c.kill-ethread evolution-2.21.1/mail/mail
}
MAIL_MT_UNLOCK(status_lock);
}
-@@ -930,7 +911,7 @@ void mail_disable_stop(void)
+@@ -961,7 +941,7 @@ operation_cancel (CamelOperation *p)
/* ******************************************************************************** */
-
+
struct _op_status_msg {
- struct _mail_msg msg;
+ MailMsg base;
-
+
struct _CamelOperation *op;
char *what;
-@@ -938,16 +919,16 @@ struct _op_status_msg {
+@@ -969,16 +949,16 @@ struct _op_status_msg {
void *data;
};
-
+
-static void do_op_status(struct _mail_msg *mm)
+static void
+op_status_exec (struct _op_status_msg *m)
@@ -6219,15 +6238,15 @@ diff -up evolution-2.21.1/mail/mail-mt.c.kill-ethread evolution-2.21.1/mail/mail
+ MailMsgPrivate *data;
char *out, *p, *o, c;
int pc;
-
+
- g_return_if_fail (pthread_equal(mail_gui_thread, pthread_self ()));
+ g_return_if_fail (mail_in_main_thread ());
-
+
MAIL_MT_LOCK (mail_msg_lock);
-
-@@ -986,8 +967,8 @@ static void do_op_status(struct _mail_ms
+
+@@ -1017,8 +997,8 @@ static void do_op_status(struct _mail_ms
progress_icon = e_icon_factory_get_icon ("mail-unread", E_ICON_SIZE_MENU);
-
+
MAIL_MT_UNLOCK (mail_msg_lock);
- if (msg->ops->describe_msg)
- what = msg->ops->describe_msg (msg, FALSE);
@@ -6236,9 +6255,9 @@ diff -up evolution-2.21.1/mail/mail-mt.c.kill-ethread evolution-2.21.1/mail/mail
else if (m->what)
what = g_strdup (m->what);
/* uncommenting because message is not very useful for a user, see bug 271734*/
-@@ -1004,13 +985,7 @@ static void do_op_status(struct _mail_ms
+@@ -1034,13 +1014,7 @@ static void do_op_status(struct _mail_ms
int activity_id = data->activity_id;
-
+
MAIL_MT_UNLOCK (mail_msg_lock);
- if (msg->cancel) {
- camel_operation_mute (msg->cancel);
@@ -6248,12 +6267,12 @@ diff -up evolution-2.21.1/mail/mail-mt.c.kill-ethread evolution-2.21.1/mail/mail
- g_free (msg->priv);
- g_free (msg);
+ mail_msg_free (msg);
-
+
if (activity_id != 0)
mail_async_event_emit (mail_async_event, MAIL_ASYNC_GUI, (MailAsyncFunc) end_event_callback,
-@@ -1030,18 +1005,17 @@ static void do_op_status(struct _mail_ms
+@@ -1060,18 +1034,17 @@ static void do_op_status(struct _mail_ms
}
-
+
static void
-do_op_status_free (struct _mail_msg *mm)
+op_status_free (struct _op_status_msg *m)
@@ -6262,7 +6281,7 @@ diff -up evolution-2.21.1/mail/mail-mt.c.kill-ethread evolution-2.21.1/mail/mail
-
g_free (m->what);
}
-
+
-static struct _mail_msg_op op_status_op = {
- NULL,
- do_op_status,
@@ -6275,39 +6294,39 @@ diff -up evolution-2.21.1/mail/mail-mt.c.kill-ethread evolution-2.21.1/mail/mail
+ (MailMsgDoneFunc) NULL,
+ (MailMsgFreeFunc) op_status_free
};
-
+
static void
-@@ -1051,7 +1025,7 @@ mail_operation_status (struct _CamelOper
-
+@@ -1081,7 +1054,7 @@ mail_operation_status (struct _CamelOper
+
d(printf("got operation statys: %s %d%%\n", what, pc));
-
+
- m = mail_msg_new(&op_status_op, NULL, sizeof(*m));
+ m = mail_msg_new(&op_status_info);
m->op = op;
m->what = g_strdup(what);
switch (pc) {
-@@ -1064,7 +1038,7 @@ mail_operation_status (struct _CamelOper
+@@ -1094,7 +1067,7 @@ mail_operation_status (struct _CamelOper
}
m->pc = pc;
m->data = data;
- e_msgport_put(mail_gui_port, (EMsg *)m);
+ mail_msg_main_loop_push(m);
}
-
+
/* ******************** */
-diff -up evolution-2.21.1/plugins/folder-unsubscribe/folder-unsubscribe.c.kill-ethread evolution-2.21.1/plugins/folder-unsubscribe/folder-unsubscribe.c
---- evolution-2.21.1/plugins/folder-unsubscribe/folder-unsubscribe.c.kill-ethread 2007-10-23 06:06:00.000000000 -0400
-+++ evolution-2.21.1/plugins/folder-unsubscribe/folder-unsubscribe.c 2007-10-29 14:47:20.000000000 -0400
-@@ -44,32 +44,30 @@ void org_gnome_mail_folder_unsubscribe (
-
-
+diff -up evolution-2.21.4/plugins/folder-unsubscribe/folder-unsubscribe.c.kill-ethread evolution-2.21.4/plugins/folder-unsubscribe/folder-unsubscribe.c
+--- evolution-2.21.4/plugins/folder-unsubscribe/folder-unsubscribe.c.kill-ethread 2007-11-29 23:24:02.000000000 -0500
++++ evolution-2.21.4/plugins/folder-unsubscribe/folder-unsubscribe.c 2007-12-17 12:33:07.000000000 -0500
+@@ -44,56 +44,53 @@ void org_gnome_mail_folder_unsubscribe (
+
+
struct _folder_unsub_t {
- struct _mail_msg msg;
+ MailMsg base;
-
+
char *uri;
};
-
+
-static char *
-folder_unsubscribe__desc (struct _mail_msg *mm, int done)
+static gchar *
@@ -6319,7 +6338,7 @@ diff -up evolution-2.21.1/plugins/folder-unsubscribe/folder-unsubscribe.c.kill-e
+ return g_strdup_printf (
+ _("Unsubscribing from folder \"%s\""), msg->uri);
}
-
+
static void
-folder_unsubscribe__unsub (struct _mail_msg *mm)
+folder_unsubscribe_exec (struct _folder_unsub_t *msg)
@@ -6329,19 +6348,25 @@ diff -up evolution-2.21.1/plugins/folder-unsubscribe/folder-unsubscribe.c.kill-e
const char *path = NULL;
CamelStore *store;
CamelURL *url;
-
+
- if (!(store = camel_session_get_store (session, unsub->uri, &mm->ex)))
-+ if (!(store = camel_session_get_store (session, msg->uri, &mm->ex)))
++ if (!(store = camel_session_get_store (session, msg->uri, &msg->base.ex)))
return;
-
+
- url = camel_url_new (unsub->uri, NULL);
+ url = camel_url_new (msg->uri, NULL);
if (((CamelService *) store)->provider->url_flags & CAMEL_URL_FRAGMENT_IS_PATH)
path = url->fragment;
else if (url->path && url->path[0])
-@@ -82,18 +80,17 @@ folder_unsubscribe__unsub (struct _mail_
- }
-
+ path = url->path + 1;
+
+ if (path != NULL)
+- camel_store_unsubscribe_folder (store, path, &mm->ex);
++ camel_store_unsubscribe_folder (store, path, &msg->base.ex);
+
+ camel_url_free (url);
+ }
+
static void
-folder_unsubscribe__free (struct _mail_msg *mm)
+folder_unsubscribe_free (struct _folder_unsub_t *msg)
@@ -6351,7 +6376,7 @@ diff -up evolution-2.21.1/plugins/folder-unsubscribe/folder-unsubscribe.c.kill-e
- g_free (unsub->uri);
+ g_free (msg->uri);
}
-
+
-static struct _mail_msg_op unsubscribe_op = {
- folder_unsubscribe__desc,
- folder_unsubscribe__unsub,
@@ -6364,85 +6389,85 @@ diff -up evolution-2.21.1/plugins/folder-unsubscribe/folder-unsubscribe.c.kill-e
+ (MailMsgDoneFunc) NULL,
+ (MailMsgFreeFunc) folder_unsubscribe_free
};
-
-
+
+
@@ -105,8 +102,8 @@ org_gnome_mail_folder_unsubscribe (EPlug
if (target->uri == NULL)
return;
-
+
- unsub = mail_msg_new (&unsubscribe_op, NULL, sizeof (struct _folder_unsub_t));
+ unsub = mail_msg_new (&unsubscribe_info);
unsub->uri = g_strdup (target->uri);
-
+
- e_thread_put (mail_thread_new, (EMsg *) unsub);
+ mail_msg_unordered_push (unsub);
}
-diff -up evolution-2.21.1/plugins/mark-all-read/mark-all-read.c.kill-ethread evolution-2.21.1/plugins/mark-all-read/mark-all-read.c
---- evolution-2.21.1/plugins/mark-all-read/mark-all-read.c.kill-ethread 2007-10-23 06:06:03.000000000 -0400
-+++ evolution-2.21.1/plugins/mark-all-read/mark-all-read.c 2007-10-29 14:47:20.000000000 -0400
+diff -up evolution-2.21.4/plugins/mark-all-read/mark-all-read.c.kill-ethread evolution-2.21.4/plugins/mark-all-read/mark-all-read.c
+--- evolution-2.21.4/plugins/mark-all-read/mark-all-read.c.kill-ethread 2007-11-29 23:24:02.000000000 -0500
++++ evolution-2.21.4/plugins/mark-all-read/mark-all-read.c 2007-12-17 12:33:07.000000000 -0500
@@ -44,7 +44,7 @@ org_gnome_mark_all_read (EPlugin *ep, EM
return;
}
-
+
- mail_get_folder(t->uri, 0, mar_got_folder, NULL, mail_thread_new);
+ mail_get_folder(t->uri, 0, mar_got_folder, NULL, mail_msg_unordered_push);
}
-
+
static void
-diff -up evolution-2.21.1/plugins/exchange-operations/exchange-folder.c.kill-ethread evolution-2.21.1/plugins/exchange-operations/exchange-folder.c
---- evolution-2.21.1/plugins/exchange-operations/exchange-folder.c.kill-ethread 2007-10-23 06:06:03.000000000 -0400
-+++ evolution-2.21.1/plugins/exchange-operations/exchange-folder.c 2007-10-29 14:47:20.000000000 -0400
+diff -up evolution-2.21.4/plugins/exchange-operations/exchange-folder.c.kill-ethread evolution-2.21.4/plugins/exchange-operations/exchange-folder.c
+--- evolution-2.21.4/plugins/exchange-operations/exchange-folder.c.kill-ethread 2007-11-29 23:24:02.000000000 -0500
++++ evolution-2.21.4/plugins/exchange-operations/exchange-folder.c 2007-12-17 12:33:07.000000000 -0500
@@ -140,7 +140,7 @@ org_gnome_exchange_folder_inbox_unsubscr
inbox_physical_uri = e_folder_get_physical_uri (inbox);
-
+
/* To get the CamelStore/Folder */
- mail_get_folder (inbox_physical_uri, 0, exchange_get_folder, target_uri, mail_thread_new);
+ mail_get_folder (inbox_physical_uri, 0, exchange_get_folder, target_uri, mail_msg_unordered_push);
-
-
+
+
}
-diff -up evolution-2.21.1/plugins/save-attachments/save-attachments.c.kill-ethread evolution-2.21.1/plugins/save-attachments/save-attachments.c
---- evolution-2.21.1/plugins/save-attachments/save-attachments.c.kill-ethread 2007-10-23 06:06:07.000000000 -0400
-+++ evolution-2.21.1/plugins/save-attachments/save-attachments.c 2007-10-29 14:47:20.000000000 -0400
-@@ -403,5 +403,5 @@ org_gnome_save_attachments_save(EPlugin
+diff -up evolution-2.21.4/plugins/save-attachments/save-attachments.c.kill-ethread evolution-2.21.4/plugins/save-attachments/save-attachments.c
+--- evolution-2.21.4/plugins/save-attachments/save-attachments.c.kill-ethread 2007-11-29 23:24:03.000000000 -0500
++++ evolution-2.21.4/plugins/save-attachments/save-attachments.c 2007-12-17 12:33:07.000000000 -0500
+@@ -403,5 +403,5 @@ org_gnome_save_attachments_save(EPlugin
camel_object_ref(data->folder);
data->uid = g_strdup(target->uids->pdata[0]);
-
+
- mail_get_message(data->folder, data->uid, save_got_message, data, mail_thread_new);
+ mail_get_message(data->folder, data->uid, save_got_message, data, mail_msg_unordered_push);
}
-diff -up evolution-2.21.1/plugins/mailing-list-actions/mailing-list-actions.c.kill-ethread evolution-2.21.1/plugins/mailing-list-actions/mailing-list-actions.c
---- evolution-2.21.1/plugins/mailing-list-actions/mailing-list-actions.c.kill-ethread 2007-10-23 06:06:05.000000000 -0400
-+++ evolution-2.21.1/plugins/mailing-list-actions/mailing-list-actions.c 2007-10-29 14:47:20.000000000 -0400
+diff -up evolution-2.21.4/plugins/mailing-list-actions/mailing-list-actions.c.kill-ethread evolution-2.21.4/plugins/mailing-list-actions/mailing-list-actions.c
+--- evolution-2.21.4/plugins/mailing-list-actions/mailing-list-actions.c.kill-ethread 2007-11-29 23:24:02.000000000 -0500
++++ evolution-2.21.4/plugins/mailing-list-actions/mailing-list-actions.c 2007-12-17 12:33:07.000000000 -0500
@@ -89,7 +89,7 @@ void emla_list_action (EPlugin *item, EM
data->uri = strdup (sel->uri);
-
+
mail_get_message (sel->folder, (const char*) g_ptr_array_index (sel->uids, 0),
- emla_list_action_do, data, mail_thread_new);
+ emla_list_action_do, data, mail_msg_unordered_push);
}
-
+
void emla_list_action_do (CamelFolder *folder, const char *uid, CamelMimeMessage *msg, void *data)
-diff -up evolution-2.21.1/plugins/itip-formatter/itip-formatter.c.kill-ethread evolution-2.21.1/plugins/itip-formatter/itip-formatter.c
---- evolution-2.21.1/plugins/itip-formatter/itip-formatter.c.kill-ethread 2007-10-23 06:06:07.000000000 -0400
-+++ evolution-2.21.1/plugins/itip-formatter/itip-formatter.c 2007-10-29 14:47:20.000000000 -0400
-@@ -1547,47 +1547,38 @@ extract_itip_data (FormatItipPObject *pi
+diff -up evolution-2.21.4/plugins/itip-formatter/itip-formatter.c.kill-ethread evolution-2.21.4/plugins/itip-formatter/itip-formatter.c
+--- evolution-2.21.4/plugins/itip-formatter/itip-formatter.c.kill-ethread 2007-12-14 09:26:42.000000000 -0500
++++ evolution-2.21.4/plugins/itip-formatter/itip-formatter.c 2007-12-17 12:33:07.000000000 -0500
+@@ -1551,47 +1551,38 @@ extract_itip_data (FormatItipPObject *pi
}
-
+
struct _opencal_msg {
- struct _mail_msg msg;
+ MailMsg base;
-
+
char *command; /* command line to run */
};
-
+
static char *
-open_calendar_desc (struct _mail_msg *mm, int done)
+open_calendar__desc (struct _opencal_msg *m, gint complete)
{
return g_strdup (_("Opening calendar"));
}
-
+
static void
-open_calendar_do (struct _mail_msg *mm)
+open_calendar__exec (struct _opencal_msg *m)
@@ -6453,7 +6478,7 @@ diff -up evolution-2.21.1/plugins/itip-formatter/itip-formatter.c.kill-ethread e
g_warning ("Could not launch %s", m->command);
}
}
-
+
static void
-open_calendar_done (struct _mail_msg *mm)
-{
@@ -6469,7 +6494,7 @@ diff -up evolution-2.21.1/plugins/itip-formatter/itip-formatter.c.kill-ethread e
g_free (m->command);
m->command = NULL;
}
-
+
-static struct _mail_msg_op open_calendar_op = {
- open_calendar_desc,
- open_calendar_do,
@@ -6482,37 +6507,37 @@ diff -up evolution-2.21.1/plugins/itip-formatter/itip-formatter.c.kill-ethread e
+ (MailMsgDoneFunc) NULL,
+ (MailMsgFreeFunc) open_calendar__free,
};
-
+
static gboolean
-@@ -1596,10 +1587,10 @@ idle_open_cb (gpointer data)
+@@ -1600,10 +1591,10 @@ idle_open_cb (gpointer data)
FormatItipPObject *pitip = data;
struct _opencal_msg *m;
-
+
- m = mail_msg_new (&open_calendar_op, NULL, sizeof (*m));
+ m = mail_msg_new (&open_calendar_info);
m->command = g_strdup_printf ("evolution \"calendar://?startdate=%s&enddate=%s\"",
isodate_from_time_t (pitip->start_time), isodate_from_time_t (pitip->end_time));
- e_thread_put (mail_thread_queued_slow, (EMsg *)m);
+ mail_msg_slow_ordered_push (m);
-
+
return FALSE;
}
-diff -up evolution-2.21.1/plugins/groupwise-features/share-folder-common.c.kill-ethread evolution-2.21.1/plugins/groupwise-features/share-folder-common.c
---- evolution-2.21.1/plugins/groupwise-features/share-folder-common.c.kill-ethread 2007-10-23 06:06:01.000000000 -0400
-+++ evolution-2.21.1/plugins/groupwise-features/share-folder-common.c 2007-10-29 14:47:20.000000000 -0400
+diff -up evolution-2.21.4/plugins/groupwise-features/share-folder-common.c.kill-ethread evolution-2.21.4/plugins/groupwise-features/share-folder-common.c
+--- evolution-2.21.4/plugins/groupwise-features/share-folder-common.c.kill-ethread 2007-11-29 23:24:02.000000000 -0500
++++ evolution-2.21.4/plugins/groupwise-features/share-folder-common.c 2007-12-17 12:33:07.000000000 -0500
@@ -121,7 +121,7 @@ shared_folder_abort (EPlugin *ep, EConfi
}
-
+
struct _EMCreateFolder {
- struct _mail_msg msg;
+ MailMsg base;
-
+
/* input data */
CamelStore *store;
@@ -137,31 +137,26 @@ struct _EMCreateFolder {
void *user_data;
};
-
+
-static char *
-create_folder__desc (struct _mail_msg *mm, int done)
+static gchar *
@@ -6522,7 +6547,7 @@ diff -up evolution-2.21.1/plugins/groupwise-features/share-folder-common.c.kill-
-
return g_strdup_printf (_("Creating folder `%s'"), m->full_name);
}
-
+
static void
-create_folder__create (struct _mail_msg *mm)
+create_folder_exec (struct _EMCreateFolder *m)
@@ -6530,7 +6555,7 @@ diff -up evolution-2.21.1/plugins/groupwise-features/share-folder-common.c.kill-
- struct _EMCreateFolder *m = (struct _EMCreateFolder *) mm;
-
d(printf ("creating folder parent='%s' name='%s' full_name='%s'\n", m->parent, m->name, m->full_name));
-
+
- if ((m->fi = camel_store_create_folder (m->store, m->parent, m->name, &mm->ex))) {
+ if ((m->fi = camel_store_create_folder (m->store, m->parent, m->name, &m->base.ex))) {
if (camel_store_supports_subscriptions (m->store))
@@ -6538,7 +6563,7 @@ diff -up evolution-2.21.1/plugins/groupwise-features/share-folder-common.c.kill-
+ camel_store_subscribe_folder (m->store, m->full_name, &m->base.ex);
}
}
-
+
static void
-create_folder__created (struct _mail_msg *mm)
+create_folder_done (struct _EMCreateFolder *m)
@@ -6549,7 +6574,7 @@ diff -up evolution-2.21.1/plugins/groupwise-features/share-folder-common.c.kill-
EGwConnection *ccnc;
@@ -180,10 +175,8 @@ create_folder__created (struct _mail_msg
}
-
+
static void
-create_folder__free (struct _mail_msg *mm)
+create_folder_free (struct _EMCreateFolder *m)
@@ -6562,7 +6587,7 @@ diff -up evolution-2.21.1/plugins/groupwise-features/share-folder-common.c.kill-
@@ -191,11 +184,12 @@ create_folder__free (struct _mail_msg *m
g_free (m->name);
}
-
+
-static struct _mail_msg_op create_folder_op = {
- create_folder__desc,
- create_folder__create,
@@ -6575,18 +6600,18 @@ diff -up evolution-2.21.1/plugins/groupwise-features/share-folder-common.c.kill-
+ (MailMsgDoneFunc) create_folder_done,
+ (MailMsgFreeFunc) create_folder_free
};
-
+
static void
-@@ -229,7 +223,7 @@ create_folder (CamelStore *store, const
+@@ -229,7 +223,7 @@ create_folder (CamelStore *store, const
parent = namebuf;
}
-
+
- m = mail_msg_new (&create_folder_op, NULL, sizeof (struct _EMCreateFolder));
+ m = mail_msg_new (&create_folder_info);
camel_object_ref (store);
m->store = store;
m->full_name = g_strdup (full_name);
-@@ -238,8 +232,8 @@ create_folder (CamelStore *store, const
+@@ -238,8 +232,8 @@ create_folder (CamelStore *store, const
m->user_data = (struct ShareInfo *) user_data;
m->done = done;
g_free (namebuf);
@@ -6594,16 +6619,16 @@ diff -up evolution-2.21.1/plugins/groupwise-features/share-folder-common.c.kill-
- e_thread_put (mail_thread_new, (EMsg *) m);
+ id = m->base.seq;
+ mail_msg_unordered_push (m);
-
+
return id;
}
-diff -up evolution-2.21.1/calendar/gui/alarm-notify/alarm-notify.h.kill-ethread evolution-2.21.1/calendar/gui/alarm-notify/alarm-notify.h
---- evolution-2.21.1/calendar/gui/alarm-notify/alarm-notify.h.kill-ethread 2007-10-23 06:12:51.000000000 -0400
-+++ evolution-2.21.1/calendar/gui/alarm-notify/alarm-notify.h 2007-10-29 14:47:20.000000000 -0400
+diff -up evolution-2.21.4/calendar/gui/alarm-notify/alarm-notify.h.kill-ethread evolution-2.21.4/calendar/gui/alarm-notify/alarm-notify.h
+--- evolution-2.21.4/calendar/gui/alarm-notify/alarm-notify.h.kill-ethread 2007-11-29 23:24:07.000000000 -0500
++++ evolution-2.21.4/calendar/gui/alarm-notify/alarm-notify.h 2007-12-17 12:33:08.000000000 -0500
@@ -39,19 +39,6 @@ typedef struct _AlarmNotifyClass AlarmNo
-
+
typedef struct _AlarmNotifyPrivate AlarmNotifyPrivate;
-
+
-typedef struct _AlarmMsg AlarmMsg;
-typedef struct _AlarmMsgPrivate AlarmMsgPrivate;
-
@@ -6619,34 +6644,34 @@ diff -up evolution-2.21.1/calendar/gui/alarm-notify/alarm-notify.h.kill-ethread
-
struct _AlarmNotify {
BonoboObject object;
-
-diff -up evolution-2.21.1/calendar/gui/alarm-notify/alarm-notify.c.kill-ethread evolution-2.21.1/calendar/gui/alarm-notify/alarm-notify.c
---- evolution-2.21.1/calendar/gui/alarm-notify/alarm-notify.c.kill-ethread 2007-10-26 01:20:38.000000000 -0400
-+++ evolution-2.21.1/calendar/gui/alarm-notify/alarm-notify.c 2007-10-29 14:47:20.000000000 -0400
+
+diff -up evolution-2.21.4/calendar/gui/alarm-notify/alarm-notify.c.kill-ethread evolution-2.21.4/calendar/gui/alarm-notify/alarm-notify.c
+--- evolution-2.21.4/calendar/gui/alarm-notify/alarm-notify.c.kill-ethread 2007-11-29 23:24:07.000000000 -0500
++++ evolution-2.21.4/calendar/gui/alarm-notify/alarm-notify.c 2007-12-17 12:33:08.000000000 -0500
@@ -45,10 +45,6 @@ struct _AlarmNotifyPrivate {
GMutex *mutex;
};
-
+
-EThread *alarm_operation_thread; /* for operations that can (or should) be queued */
-EMsgPort *alarm_reply_port;
-static GIOChannel *alarm_reply_channel;
-
#define d(x) x
-
+
@@ -286,72 +282,12 @@ alarm_notify_finalize (GObject *object)
g_mutex_free (priv->mutex);
g_free (priv);
-
+
- e_thread_destroy(alarm_operation_thread);
- g_io_channel_unref(alarm_reply_channel);
- e_msgport_destroy(alarm_reply_port);
if (G_OBJECT_CLASS (parent_class)->finalize)
(* G_OBJECT_CLASS (parent_class)->finalize) (object);
}
-
+
-
+
-static guint
-alarm_channel_setup(EMsgPort **port, GIOChannel **channel, GIOFunc func)
-{
@@ -6733,15 +6758,15 @@ diff -up evolution-2.21.1/calendar/gui/alarm-notify/alarm-notify.c.kill-ethread
+ ORBIT_THREAD_HINT_PER_REQUEST, NULL),
+ NULL);
}
-
+
static void
-diff -up evolution-2.21.1/calendar/gui/alarm-notify/alarm-queue.c.kill-ethread evolution-2.21.1/calendar/gui/alarm-notify/alarm-queue.c
---- evolution-2.21.1/calendar/gui/alarm-notify/alarm-queue.c.kill-ethread 2007-10-26 01:20:38.000000000 -0400
-+++ evolution-2.21.1/calendar/gui/alarm-notify/alarm-queue.c 2007-10-29 14:47:20.000000000 -0400
+diff -up evolution-2.21.4/calendar/gui/alarm-notify/alarm-queue.c.kill-ethread evolution-2.21.4/calendar/gui/alarm-notify/alarm-queue.c
+--- evolution-2.21.4/calendar/gui/alarm-notify/alarm-queue.c.kill-ethread 2007-11-29 23:24:07.000000000 -0500
++++ evolution-2.21.4/calendar/gui/alarm-notify/alarm-queue.c 2007-12-17 12:33:08.000000000 -0500
@@ -98,9 +98,6 @@ static int tray_blink_id = -1;
static int tray_blink_state = FALSE;
static AlarmNotify *an;
-
+
-/* Main Tasks thread for dealing with the global structures */
-extern EThread *alarm_operation_thread;
-
@@ -6751,7 +6776,7 @@ diff -up evolution-2.21.1/calendar/gui/alarm-notify/alarm-queue.c.kill-ethread e
@@ -182,6 +179,40 @@ static void on_dialog_objs_removed_cb (E
static void load_alarms_for_today (ClientAlarms *ca);
static void midnight_refresh_cb (gpointer alarm_id, time_t trigger, gpointer data);
-
+
+/* Simple asynchronous message dispatcher */
+
+typedef struct _Message Message;
@@ -6791,12 +6816,12 @@ diff -up evolution-2.21.1/calendar/gui/alarm-notify/alarm-queue.c.kill-ethread e
*/
@@ -220,47 +251,41 @@ add_client_alarms_cb (gpointer key, gpoi
}
-
+
struct _midnight_refresh_msg {
+ Message header;
gboolean remove;
};
-
+
/* Loads the alarms for the new day every midnight */
static void
-midnight_refresh_async (EThread *e, AlarmMsg *msg, void *data)
@@ -6805,10 +6830,10 @@ diff -up evolution-2.21.1/calendar/gui/alarm-notify/alarm-queue.c.kill-ethread e
- struct _midnight_refresh_msg *list = msg->data;
-
d(printf("%s:%d (midnight_refresh_async) \n",__FILE__, __LINE__));
-
+
/* Re-load the alarms for all clients */
g_hash_table_foreach (client_alarms_hash, add_client_alarms_cb, NULL);
-
+
/* Re-schedule the midnight update */
- if (list->remove && midnight_refresh_id != NULL) {
+ if (msg->remove && midnight_refresh_id != NULL) {
@@ -6816,12 +6841,12 @@ diff -up evolution-2.21.1/calendar/gui/alarm-notify/alarm-queue.c.kill-ethread e
alarm_remove (midnight_refresh_id);
midnight_refresh_id = NULL;
}
-
+
queue_midnight_refresh ();
+
+ g_slice_free (struct _midnight_refresh_msg, msg);
}
-
+
static void
midnight_refresh_cb (gpointer alarm_id, time_t trigger, gpointer data)
{
@@ -6834,18 +6859,18 @@ diff -up evolution-2.21.1/calendar/gui/alarm-notify/alarm-queue.c.kill-ethread e
-
- list = malloc (sizeof (struct _midnight_refresh_msg));
+ struct _midnight_refresh_msg *msg;
-
+
- list->remove = TRUE;
- msg->data = list;
+ msg = g_slice_new (struct _midnight_refresh_msg);
+ msg->header.func = (MessageFunc) midnight_refresh_async;
+ msg->remove = TRUE;
-
+
- d(printf("%s:%d (midnight_refresh_cb) - Invoking task for midnight refresh\n",__FILE__, __LINE__));
- e_thread_put(alarm_operation_thread, (EMsg *)msg);
+ message_push ((Message *) msg);
}
-
+
/* Looks up a client in the client alarms hash table */
@@ -658,6 +683,7 @@ remove_comp (ClientAlarms *ca, ECalCompo
* alarms.
@@ -6857,7 +6882,7 @@ diff -up evolution-2.21.1/calendar/gui/alarm-notify/alarm-queue.c.kill-ethread e
gpointer data;
@@ -691,7 +717,7 @@ duplicate_ecal (GList *in_list)
}
-
+
static void
-query_objects_changed_async (EThread *e, AlarmMsg *msg, void *data)
+query_objects_changed_async (struct _query_msg *msg)
@@ -6871,14 +6896,14 @@ diff -up evolution-2.21.1/calendar/gui/alarm-notify/alarm-queue.c.kill-ethread e
- struct _query_msg *list = msg->data;
ECal *client;
GList *objects;
-
+
- client = list->client;
- ca = list->data;
- objects = list->objects;
+ client = msg->client;
+ ca = msg->data;
+ objects = msg->objects;
-
+
from = config_data_get_last_notification_time ();
if (from == -1)
@@ -800,43 +825,38 @@ query_objects_changed_async (EThread *e,
@@ -6888,14 +6913,13 @@ diff -up evolution-2.21.1/calendar/gui/alarm-notify/alarm-queue.c.kill-ethread e
+
+ g_slice_free (struct _query_msg, msg);
}
-
+
static void
query_objects_changed_cb (ECal *client, GList *objects, gpointer data)
{
- AlarmMsg *msg;
- struct _query_msg *list;
-+ struct _query_msg *msg;
-
+-
- /* These two structures will be freed by the msg destroy function*/
- msg = malloc (sizeof (AlarmMsg));
- msg->receive_msg = query_objects_changed_async;
@@ -6904,7 +6928,8 @@ diff -up evolution-2.21.1/calendar/gui/alarm-notify/alarm-queue.c.kill-ethread e
- list->objects = duplicate_ical (objects);
- list->data = data;
- msg->data = list;
--
++ struct _query_msg *msg;
+
- d(printf("%s:%d (query_objects_changed_cb) - Posting a task\n",__FILE__, __LINE__));
- e_thread_put(alarm_operation_thread, (EMsg *)msg);
+ msg = g_slice_new (struct _query_msg);
@@ -6912,10 +6937,10 @@ diff -up evolution-2.21.1/calendar/gui/alarm-notify/alarm-queue.c.kill-ethread e
+ msg->client = client;
+ msg->objects = duplicate_ical (objects);
+ msg->data = data;
-
+
+ message_push ((Message *) msg);
}
-
+
/* Called when a calendar component is removed; we must delete its corresponding
* alarms.
*/
@@ -6928,24 +6953,24 @@ diff -up evolution-2.21.1/calendar/gui/alarm-notify/alarm-queue.c.kill-ethread e
- struct _query_msg *list = msg->data;
ECal *client;
GList *objects;
-
+
- client = list->client;
- ca = list->data;
- objects = list->objects;
+ client = msg->client;
+ ca = msg->data;
+ objects = msg->objects;
-
+
d(printf("%s:%d (query_objects_removed_async) - Removing %d objects\n",__FILE__, __LINE__, g_list_length(objects)));
-
+
@@ -849,27 +869,22 @@ query_objects_removed_async (EThread *e,
}
-
+
g_list_free (objects);
+
+ g_slice_free (struct _query_msg, msg);
}
-
+
static void
query_objects_removed_cb (ECal *client, GList *objects, gpointer data)
{
@@ -6962,7 +6987,7 @@ diff -up evolution-2.21.1/calendar/gui/alarm-notify/alarm-queue.c.kill-ethread e
- list->data = data;
- msg->data = list;
+ struct _query_msg *msg;
-
+
- d(printf("%s:%d (query_objects_removed_cb) - Posting a task\n",__FILE__, __LINE__));
- e_thread_put(alarm_operation_thread, (EMsg *)msg);
+ msg = g_slice_new (struct _query_msg);
@@ -6970,14 +6995,14 @@ diff -up evolution-2.21.1/calendar/gui/alarm-notify/alarm-queue.c.kill-ethread e
+ msg->client = client;
+ msg->objects = duplicate_ecal (objects);
+ msg->data = data;
-
+
+ message_push ((Message *) msg);
}
-
+
@@ -1011,20 +1026,19 @@ free_tray_icon_data (TrayIconData *tray_
}
-
+
static void
-on_dialog_objs_removed_async (EThread *e, AlarmMsg *msg, void *data)
+on_dialog_objs_removed_async (struct _query_msg *msg)
@@ -6988,16 +7013,16 @@ diff -up evolution-2.21.1/calendar/gui/alarm-notify/alarm-queue.c.kill-ethread e
- struct _query_msg *list = msg->data;
ECal *client;
GList *objects;
-
+
d(printf("%s:%d (on_dialog_objs_removed_async)\n",__FILE__, __LINE__));
-
+
- client = list->client;
- tray_data = list->data;
- objects = list->objects;
+ client = msg->client;
+ tray_data = msg->data;
+ objects = msg->objects;
-
+
e_cal_component_get_uid (tray_data->comp, &our_uid);
g_return_if_fail (our_uid && *our_uid);
@@ -1042,37 +1056,33 @@ on_dialog_objs_removed_async (EThread *e
@@ -7007,14 +7032,14 @@ diff -up evolution-2.21.1/calendar/gui/alarm-notify/alarm-queue.c.kill-ethread e
+
+ g_slice_free (struct _query_msg, msg);
}
-
+
static void
on_dialog_objs_removed_cb (ECal *client, GList *objects, gpointer data)
{
- AlarmMsg *msg;
- struct _query_msg *list;
+ struct _query_msg *msg;
-
+
- /* These two structures will be freed by the msg destroy function*/
- msg = malloc (sizeof (AlarmMsg));
- msg->receive_msg = on_dialog_objs_removed_async;
@@ -7029,17 +7054,17 @@ diff -up evolution-2.21.1/calendar/gui/alarm-notify/alarm-queue.c.kill-ethread e
+ msg->client = client;
+ msg->objects = objects;
+ msg->data = data;
-
+
- d(printf("%s:%d (on_dialog_objs_removed_cb) - Posting a task \n",__FILE__, __LINE__));
- e_thread_put(alarm_operation_thread, (EMsg *)msg);
+ message_push ((Message *) msg);
}
-
+
struct _tray_cqa_msg {
+ Message header;
CompQueuedAlarms *cqa;
};
-
+
static void
-tray_list_remove_cqa_async(EThread *e, AlarmMsg *msg, void *data)
+tray_list_remove_cqa_async (struct _tray_cqa_msg *msg)
@@ -7048,7 +7073,7 @@ diff -up evolution-2.21.1/calendar/gui/alarm-notify/alarm-queue.c.kill-ethread e
- CompQueuedAlarms *cqa = tmsg->cqa;
+ CompQueuedAlarms *cqa = msg->cqa;
GList *list = tray_icons_list;
-
+
d(printf("%s:%d (tray_list_remove_cqa_async) - Removing CQA %p from tray list\n",__FILE__, __LINE__, cqa));
@@ -1111,28 +1121,25 @@ tray_list_remove_cqa_async(EThread *e, A
gtk_tree_selection_select_iter (sel, &iter);
@@ -7057,7 +7082,7 @@ diff -up evolution-2.21.1/calendar/gui/alarm-notify/alarm-queue.c.kill-ethread e
+
+ g_slice_free (struct _tray_cqa_msg, msg);
}
-
+
static void
tray_list_remove_cqa (CompQueuedAlarms *cqa)
{
@@ -7075,19 +7100,19 @@ diff -up evolution-2.21.1/calendar/gui/alarm-notify/alarm-queue.c.kill-ethread e
+ msg = g_slice_new (struct _tray_cqa_msg);
+ msg->header.func = (MessageFunc) tray_list_remove_cqa_async;
+ msg->cqa = cqa;
-
+
- d(printf("%s:%d (tray_list_remove_cqa) - Posting a task\n",__FILE__, __LINE__));
- e_thread_put(alarm_operation_thread, (EMsg *)msg);
+ message_push ((Message *) msg);
}
-
+
/* Callback used from the alarm notify dialog */
static void
-tray_list_remove_async(EThread *e, AlarmMsg *msg, void *data)
+tray_list_remove_async (Message *msg)
{
GList *list = tray_icons_list;
-
+
@@ -1162,55 +1169,50 @@ tray_list_remove_async(EThread *e, Alarm
} else
list = list->next;
@@ -7095,7 +7120,7 @@ diff -up evolution-2.21.1/calendar/gui/alarm-notify/alarm-queue.c.kill-ethread e
+
+ g_slice_free (Message, msg);
}
-
+
static void
tray_list_remove_icons (void)
{
@@ -7105,21 +7130,21 @@ diff -up evolution-2.21.1/calendar/gui/alarm-notify/alarm-queue.c.kill-ethread e
- msg = malloc (sizeof (AlarmMsg));
- msg->receive_msg = tray_list_remove_async;
+ Message *msg;
-
+
- msg->data = NULL;
+ msg = g_slice_new (Message);
+ msg->func = tray_list_remove_async;
-
+
- d(printf("%s:%d (tray_list_remove_icons) - Posting a task\n",__FILE__, __LINE__));
- e_thread_put(alarm_operation_thread, (EMsg *)msg);
+ message_push (msg);
}
-
+
struct _tray_msg {
+ Message header;
TrayIconData *data;
};
-
+
static void
-tray_list_remove_data_async(EThread *e, AlarmMsg *msg, void *data)
+tray_list_remove_data_async (struct _tray_msg *msg)
@@ -7127,16 +7152,16 @@ diff -up evolution-2.21.1/calendar/gui/alarm-notify/alarm-queue.c.kill-ethread e
- struct _tray_msg *tmsg = msg->data;
- TrayIconData *tray_data = tmsg->data;
+ TrayIconData *tray_data = msg->data;
-
+
d(printf("%s:%d (tray_list_remove_data_async) - Removing %p from tray list\n",__FILE__, __LINE__, tray_data));
-
+
tray_icons_list = g_list_remove_all (tray_icons_list, tray_data);
free_tray_icon_data (tray_data);
tray_data = NULL;
+
+ g_slice_free (struct _tray_msg, msg);
}
-
+
static void
tray_list_remove_data (TrayIconData *data)
{
@@ -7150,20 +7175,20 @@ diff -up evolution-2.21.1/calendar/gui/alarm-notify/alarm-queue.c.kill-ethread e
- list->data = data;
- msg->data = list;
+ struct _tray_msg *msg;
-+
+
+- d(printf("%s:%d (tray_list_remove_data) - Posting a task\n",__FILE__, __LINE__));
+- e_thread_put(alarm_operation_thread, (EMsg *)msg);
+ msg = g_slice_new (struct _tray_msg);
+ msg->header.func = (MessageFunc) tray_list_remove_data_async;
+ msg->data = data;
-
-- d(printf("%s:%d (tray_list_remove_data) - Posting a task\n",__FILE__, __LINE__));
-- e_thread_put(alarm_operation_thread, (EMsg *)msg);
++
+ message_push ((Message *) msg);
}
-
+
static void
-@@ -1417,29 +1419,24 @@ tray_icon_blink_cb (gpointer data)
+@@ -1417,29 +1419,23 @@ tray_icon_blink_cb (gpointer data)
/* Add a new data to tray list */
-
+
static void
-tray_list_add_async (EThread *e, AlarmMsg *msg, void *data)
+tray_list_add_async (struct _tray_msg *msg)
@@ -7171,19 +7196,18 @@ diff -up evolution-2.21.1/calendar/gui/alarm-notify/alarm-queue.c.kill-ethread e
- struct _tray_msg *list = msg->data;
- d(printf("%s:%d (tray_list_add_async) - Add %p\n",__FILE__, __LINE__, list->data));
- tray_icons_list = g_list_prepend (tray_icons_list, list->data);
-+ d(printf("%s:%d (tray_list_add_async) - Add %p\n",__FILE__, __LINE__, msg->data));
+ tray_icons_list = g_list_prepend (tray_icons_list, msg->data);
+
+ g_slice_free (struct _tray_msg, msg);
}
-
+
static void
tray_list_add_new (TrayIconData *data)
{
- AlarmMsg *msg;
- struct _tray_msg *list;
+ struct _tray_msg *msg;
-
+
- /* These two structures will be freed by the msg destroy function*/
- msg = malloc (sizeof (AlarmMsg));
- msg->receive_msg = tray_list_add_async;
@@ -7191,52 +7215,51 @@ diff -up evolution-2.21.1/calendar/gui/alarm-notify/alarm-queue.c.kill-ethread e
- list = malloc (sizeof (struct _tray_msg));
- list->data = data;
- msg->data = list;
--
-- d(printf("%s:%d (tray_list_add_new) - Posting a task\n",__FILE__, __LINE__));
-- e_thread_put(alarm_operation_thread, (EMsg *)msg);
+ msg = g_slice_new (struct _tray_msg);
+ msg->header.func = (MessageFunc) tray_list_add_async;
+ msg->data = data;
-+
+
+- d(printf("%s:%d (tray_list_add_new) - Posting a task\n",__FILE__, __LINE__));
+- e_thread_put(alarm_operation_thread, (EMsg *)msg);
+ message_push ((Message *) msg);
}
-
+
/* Performs notification of a display alarm */
-@@ -1836,21 +1833,13 @@ check_midnight_refresh (gpointer user_da
+@@ -1836,21 +1832,13 @@ check_midnight_refresh (gpointer user_da
new_midnight = time_day_end_with_zone (time (NULL), zone);
-
+
if (new_midnight > midnight) {
- AlarmMsg *msg;
- struct _midnight_refresh_msg *list;
--
++ struct _midnight_refresh_msg *msg;
+
- /* These two structures will be freed by the msg destroy function*/
- msg = malloc (sizeof (AlarmMsg));
- msg->receive_msg = midnight_refresh_async;
--
++ msg = g_slice_new (struct _midnight_refresh_msg);
++ msg->header.func = (MessageFunc) midnight_refresh_async;
++ msg->remove = FALSE;
+
- list = malloc (sizeof (struct _midnight_refresh_msg));
-+ struct _midnight_refresh_msg *msg;
-
+-
- list->remove = FALSE;
- /* We dont need it. So set it to NULL */
- msg->data = list;
-+ msg = g_slice_new (struct _midnight_refresh_msg);
-+ msg->header.func = (MessageFunc) midnight_refresh_async;
-+ msg->remove = FALSE;
-
+-
- d(printf("%s:%d (check_midnight_refresh) - Posting a task to refresh\n",__FILE__, __LINE__));
- e_thread_put(alarm_operation_thread, (EMsg *)msg);
+ message_push ((Message *) msg);
}
-
+
return TRUE;
-@@ -1981,14 +1970,15 @@ hash_ids (gpointer a)
+@@ -1981,14 +1969,15 @@ hash_ids (gpointer a)
}
-
+
struct _alarm_client_msg {
+ Message header;
ECal *client;
};
-
+
-static void alarm_queue_add_async (EThread *e, AlarmMsg *msg, void *data)
+static void
+alarm_queue_add_async (struct _alarm_client_msg *msg)
@@ -7245,26 +7268,26 @@ diff -up evolution-2.21.1/calendar/gui/alarm-notify/alarm-queue.c.kill-ethread e
- struct _alarm_client_msg *list = msg->data;
- ECal *client = list->client;
+ ECal *client = msg->client;
-
+
g_return_if_fail (alarm_queue_inited);
g_return_if_fail (client != NULL);
-@@ -2019,6 +2009,8 @@ static void alarm_queue_add_async (EThre
+@@ -2019,6 +2008,8 @@ static void alarm_queue_add_async (EThre
G_CALLBACK (cal_opened_cb),
ca);
}
+
+ g_slice_free (struct _alarm_client_msg, msg);
}
-
+
/**
-@@ -2038,20 +2030,13 @@ static void alarm_queue_add_async (EThre
+@@ -2038,20 +2029,13 @@ static void alarm_queue_add_async (EThre
void
alarm_queue_add_client (ECal *client)
{
- AlarmMsg *msg;
- struct _alarm_client_msg *list;
+ struct _alarm_client_msg *msg;
-
+
- /* These two structures will be freed by the msg destroy function*/
- msg = malloc (sizeof (AlarmMsg));
- msg->receive_msg = alarm_queue_add_async;
@@ -7276,14 +7299,14 @@ diff -up evolution-2.21.1/calendar/gui/alarm-notify/alarm-queue.c.kill-ethread e
+ msg = g_slice_new (struct _alarm_client_msg);
+ msg->header.func = (MessageFunc) alarm_queue_add_async;
+ msg->client = g_object_ref (client);
-
+
- d(printf("%s:%d (alarm_queue_add_client) - Posting a task\n",__FILE__, __LINE__));
- e_thread_put(alarm_operation_thread, (EMsg *)msg);
+ message_push ((Message *) msg);
}
-
+
/* Removes a component an its alarms */
-@@ -2103,11 +2088,10 @@ remove_client_alarms (ClientAlarms *ca)
+@@ -2103,11 +2087,10 @@ remove_client_alarms (ClientAlarms *ca)
* Removes a calendar client from the alarm queueing system.
**/
static void
@@ -7294,26 +7317,26 @@ diff -up evolution-2.21.1/calendar/gui/alarm-notify/alarm-queue.c.kill-ethread e
- struct _alarm_client_msg *list = msg->data;
- ECal *client = list->client;
+ ECal *client = msg->client;
-
+
g_return_if_fail (alarm_queue_inited);
g_return_if_fail (client != NULL);
-@@ -2144,6 +2128,8 @@ alarm_queue_remove_async (EThread *e, Al
+@@ -2144,6 +2127,8 @@ alarm_queue_remove_async (EThread *e, Al
g_free (ca);
-
+
g_hash_table_remove (client_alarms_hash, client);
+
+ g_slice_free (struct _alarm_client_msg, msg);
}
-
+
/** alarm_queue_remove_client
-@@ -2156,24 +2142,16 @@ alarm_queue_remove_async (EThread *e, Al
+@@ -2156,24 +2141,16 @@ alarm_queue_remove_async (EThread *e, Al
void
alarm_queue_remove_client (ECal *client, gboolean immediately)
{
- AlarmMsg *msg;
- struct _alarm_client_msg *list;
+ struct _alarm_client_msg *msg;
-
+
- /* These two structures will be freed by the msg destroy function*/
- msg = malloc (sizeof (AlarmMsg));
- msg->receive_msg = alarm_queue_remove_async;
@@ -7324,7 +7347,7 @@ diff -up evolution-2.21.1/calendar/gui/alarm-notify/alarm-queue.c.kill-ethread e
+ msg = g_slice_new (struct _alarm_client_msg);
+ msg->header.func = (MessageFunc) alarm_queue_remove_async;
+ msg->client = client;
-
+
- d(printf("%s:%d (alarm_queue_remove_client) - Posting a task\n",__FILE__, __LINE__));
if (immediately) {
- alarm_queue_remove_async (NULL, msg, NULL);
@@ -7335,5 +7358,5 @@ diff -up evolution-2.21.1/calendar/gui/alarm-notify/alarm-queue.c.kill-ethread e
- e_thread_put(alarm_operation_thread, (EMsg *)msg);
+ message_push ((Message *) msg);
}
-
+
/* Update non-time related variables for various structures on modification of an existing component
diff --git a/evolution-2.9.3-view-attachment-uri.patch b/evolution-2.9.3-view-attachment-uri.patch
deleted file mode 100644
index a506488..0000000
--- a/evolution-2.9.3-view-attachment-uri.patch
+++ /dev/null
@@ -1,46 +0,0 @@
---- evolution-2.9.3/mail/mail-ops.c.view-attachment-uri 2006-12-06 10:26:24.000000000 -0500
-+++ evolution-2.9.3/mail/mail-ops.c 2006-12-06 11:16:46.000000000 -0500
-@@ -2089,21 +2089,23 @@
- save_part_save (struct _mail_msg *mm)
- {
- struct _save_part_msg *m = (struct _save_part_msg *)mm;
-+ mode_t mode = S_IRUSR | S_IRGRP | S_IROTH;
-+ int flags = O_WRONLY | O_CREAT | O_TRUNC;
- CamelDataWrapper *content;
- CamelStream *stream;
--
-- if(!m->readonly){
-- if (!(stream = camel_stream_vfs_new_with_uri (m->path, O_WRONLY | O_CREAT | O_TRUNC, 0644))) {
-- camel_exception_setv (&mm->ex, CAMEL_EXCEPTION_SYSTEM,
-- _("Cannot create output file: %s:\n %s"),
-- m->path, g_strerror (errno));
-- return;
-- }
-- } else if (!(stream = camel_stream_vfs_new_with_uri (m->path, O_WRONLY | O_CREAT | O_TRUNC, 0444))) {
-+ gchar *uri;
-+
-+ uri = g_filename_to_uri (m->path, NULL, NULL);
-+
-+ if (!m->readonly)
-+ mode |= S_IWUSR;
-+
-+ stream = camel_stream_vfs_new_with_uri (uri, flags, mode);
-+ if (stream == NULL) {
- camel_exception_setv (&mm->ex, CAMEL_EXCEPTION_SYSTEM,
- _("Cannot create output file: %s:\n %s"),
- m->path, g_strerror (errno));
-- return;
-+ goto exit;
- }
-
- content = camel_medium_get_content_object (CAMEL_MEDIUM (m->part));
-@@ -2115,6 +2117,9 @@
- g_strerror (errno));
-
- camel_object_unref (stream);
-+
-+exit:
-+ g_free (uri);
- }
-
- static void
diff --git a/evolution.spec b/evolution.spec
index ac69b5b..ca5674f 100644
--- a/evolution.spec
+++ b/evolution.spec
@@ -1,6 +1,6 @@
%define dbus_glib_version 0.70
%define dbus_version 1.0
-%define eds_version 2.21.3
+%define eds_version 2.21.4
%define gnome_doc_utils_version 0.8.0
%define gnome_icon_theme_version 2.19.91
%define gnome_pilot_version 2.0.15
@@ -44,8 +44,8 @@
### Abstract ###
Name: evolution
-Version: 2.21.3
-Release: 4%{?dist}
+Version: 2.21.4
+Release: 1%{?dist}
License: GPLv2 and GFDL+
Group: Applications/Productivity
Summary: GNOME's next-generation groupware suite
@@ -66,50 +66,42 @@ Patch11: evolution-2.5.5.1-commit-enter-on-calendar.patch
# Fix for RH bug 164957 (was for 145552):
Patch12: evolution-2.0.2-fix-145552.patch
-# Part of RH bug 170799:
-# XXX Revert this for Fedora 9
-#Patch13: evolution-2.4.1-hide-switcher-buttons-by-default.patch
-
# Patches for conduits, based upon
# rh-161817-attach-116019-conduit_pilot_link_updates.diff
# (the latter patch was originally by Mark G. Adams):
-# Patch14: evolution-2.5.4-fix-conduits.patch
+# Patch13: evolution-2.5.4-fix-conduits.patch
# Move .conduit files from share to lib (for the sake of multilib)
# This patch effects other parts of evolution.spec and so is necessary
# for a successful build.
-Patch15: evolution-2.5.4-fix-conduit-dir.patch
+Patch14: evolution-2.5.4-fix-conduit-dir.patch
# Remove gnome-common macros from configure.in.
# We do not ship gnome-common (or at least we're not supposed to).
-Patch16: evolution-2.7.1-no-gnome-common.patch
+Patch15: evolution-2.7.1-no-gnome-common.patch
-#Patch17: evolution-2.7.1-notification-cleanups.patch
+#Patch16: evolution-2.7.1-notification-cleanups.patch
# RH bug #166231 / GNOME bug #264485
-Patch20: evolution-2.7.3-replicated-cjk-input.patch
+Patch17: evolution-2.7.3-replicated-cjk-input.patch
# RH bug #178295 / GNOME bug #348638
-Patch21: evolution-2.7.4-deleting-preedit-buffer.patch
+Patch18: evolution-2.7.4-deleting-preedit-buffer.patch
# GNOME bug #362638
-Patch25: evolution-2.8.1-kill-ethread.patch
+Patch19: evolution-2.8.1-kill-ethread.patch
# GNOME bug #363695
-Patch26: evolution-2.9.1-kill-ememory.patch
+Patch20: evolution-2.9.1-kill-ememory.patch
# RH bug #176400
-Patch27: evolution-2.9.1-im-context-reset.patch
-
-# RH bug #216537 / GNOME bug #383047
-#Patch29: evolution-2.9.3-view-attachment-uri.patch
+Patch21: evolution-2.9.1-im-context-reset.patch
# RH bug #215478 / GNOME bug #383842
-Patch30: evolution-2.9.3-source-path-entry.patch
+Patch22: evolution-2.9.3-source-path-entry.patch
-# GNOME bug #376991
-# XXX Disabled due to outstanding issues.
-#Patch33: evolution-2.10.0-e-passwords.patch
+# GNOME bug #504030
+Patch23: evolution-2.21.4-too-noisy.patch
## Dependencies ###
@@ -249,19 +241,17 @@ This package contains the plugin to filter junk mail using SpamAssassin.
%patch10 -p1 -b .ldaphack
%patch11 -p1 -b .commit-enter-on-calendar
%patch12 -p1 -b .fix-164957
-#patch13 -p1 -b .hide-switcher-buttons-by-default
-#patch14 -p1 -b .fix-conduits # leave commented
-%patch15 -p1 -b .fix-conduit-dir
-%patch16 -p1 -b .no-gnome-common
-#patch17 -p1 -b .notification-cleanups
-%patch20 -p1 -b .replicated-cjk-input
-%patch21 -p1 -b .deleting-preedit-buffer
-%patch25 -p1 -b .kill-ethread
-%patch26 -p1 -b .kill-ememory
-%patch27 -p1 -b .im-context-reset
-#%patch29 -p1 -b .view-attachment-uri
-%patch30 -p1 -b .source-path-entry
-#%patch33 -p1 -b .e-passwords
+#patch13 -p1 -b .fix-conduits # leave commented
+%patch14 -p1 -b .fix-conduit-dir
+%patch15 -p1 -b .no-gnome-common
+#patch16 -p1 -b .notification-cleanups
+%patch17 -p1 -b .replicated-cjk-input
+%patch18 -p1 -b .deleting-preedit-buffer
+%patch19 -p1 -b .kill-ethread
+%patch20 -p1 -b .kill-ememory
+%patch21 -p1 -b .im-context-reset
+%patch22 -p1 -b .source-path-entry
+%patch23 -p1 -b .too-noisy
mkdir -p krb5-fakeprefix/include
mkdir -p krb5-fakeprefix/lib
@@ -694,6 +684,11 @@ rm -rf $RPM_BUILD_ROOT
%{evo_plugin_dir}/liborg-gnome-sa-junk-plugin.so
%changelog
+* Mon Dec 17 2007 Matthew Barnes - 2.21.4-1.fc9
+- Update to 2.21.4
+- Expunge unused patches.
+- Bump eds_version to 2.21.4 for new Camel functions.
+
* Mon Dec 10 2007 Matthew Barnes - 2.21.3-4.fc9
- Split junk filtering plugins into evolution-bogofilter and
evolution-spamassassin subpackages, each of which requires the