diff options
author | Matthew Barnes <mbarnes@redhat.com> | 2011-05-12 00:11:36 +0800 |
---|---|---|
committer | Matthew Barnes <mbarnes@redhat.com> | 2011-05-12 00:59:17 +0800 |
commit | c780b7d21255a5e6a0f15af12e02accbda088f3b (patch) | |
tree | 81a5d52411f61289dc47dbdbdf481fb7dfbf9b79 | |
parent | 2b4ea9419a625031a449ba0d6554d525f8cd2538 (diff) | |
download | gsoc2013-evolution-c780b7d21255a5e6a0f15af12e02accbda088f3b.tar.gz gsoc2013-evolution-c780b7d21255a5e6a0f15af12e02accbda088f3b.tar.zst gsoc2013-evolution-c780b7d21255a5e6a0f15af12e02accbda088f3b.zip |
Remove mail_get_messages().
Use e_mail_folder_get_multiple_messages() instead.
-rw-r--r-- | mail/mail-ops.c | 94 | ||||
-rw-r--r-- | mail/mail-ops.h | 5 |
2 files changed, 0 insertions, 99 deletions
diff --git a/mail/mail-ops.c b/mail/mail-ops.c index 8c13507545..a5210559a6 100644 --- a/mail/mail-ops.c +++ b/mail/mail-ops.c @@ -1960,100 +1960,6 @@ mail_get_message (CamelFolder *folder, const gchar *uid, void (*done) (CamelFold return id; } -/* ********************************************************************** */ - -struct _get_messages_msg { - MailMsg base; - - CamelFolder *folder; - GPtrArray *uids; - GPtrArray *messages; - - void (*done) (CamelFolder *folder, GPtrArray *uids, GPtrArray *msgs, gpointer data); - gpointer data; -}; - -static gchar * -get_messages_desc (struct _get_messages_msg *m) -{ - return g_strdup_printf(ngettext("Retrieving %d message", - "Retrieving %d messages", m->uids->len), - m->uids->len); -} - -static void -get_messages_exec (struct _get_messages_msg *m, - GCancellable *cancellable, - GError **error) -{ - gint i; - CamelMimeMessage *message; - - for (i=0; i<m->uids->len; i++) { - gint pc = ((i+1) * 100) / m->uids->len; - - message = camel_folder_get_message_sync ( - m->folder, m->uids->pdata[i], - cancellable, error); - camel_operation_progress (cancellable, pc); - if (message == NULL) - break; - - g_ptr_array_add (m->messages, message); - } -} - -static void -get_messages_done (struct _get_messages_msg *m) -{ - if (m->done) - m->done (m->folder, m->uids, m->messages, m->data); -} - -static void -get_messages_free (struct _get_messages_msg *m) -{ - gint i; - - em_utils_uids_free (m->uids); - for (i=0;i<m->messages->len;i++) { - if (m->messages->pdata[i]) - g_object_unref (m->messages->pdata[i]); - } - g_ptr_array_free (m->messages, TRUE); - g_object_unref (m->folder); -} - -static MailMsgInfo get_messages_info = { - sizeof (struct _get_messages_msg), - (MailMsgDescFunc) get_messages_desc, - (MailMsgExecFunc) get_messages_exec, - (MailMsgDoneFunc) get_messages_done, - (MailMsgFreeFunc) get_messages_free -}; - -gint -mail_get_messages (CamelFolder *folder, GPtrArray *uids, - void (*done) (CamelFolder *folder, GPtrArray *uids, GPtrArray *msgs, gpointer data), - gpointer data) -{ - struct _get_messages_msg *m; - gint id; - - m = mail_msg_new (&get_messages_info); - m->folder = folder; - g_object_ref (folder); - m->uids = uids; - m->messages = g_ptr_array_new (); - m->data = data; - m->done = done; - id = m->base.seq; - - mail_msg_unordered_push (m); - - return id; -} - /* ** SAVE MESSAGES ******************************************************* */ struct _save_messages_msg { diff --git a/mail/mail-ops.h b/mail/mail-ops.h index ac78fdf7c1..f773c825f7 100644 --- a/mail/mail-ops.h +++ b/mail/mail-ops.h @@ -47,11 +47,6 @@ gint mail_get_message (CamelFolder *folder, const gchar *uid, gpointer data, MailMsgDispatchFunc dispatch); -/* get several messages */ -gint mail_get_messages (CamelFolder *folder, GPtrArray *uids, - void (*done) (CamelFolder *folder, GPtrArray *uids, GPtrArray *msgs, gpointer data), - gpointer data); - /* same for a folder */ gint mail_get_folder (EMailSession *session, const gchar *uri, |