diff options
author | Matthew Barnes <mbarnes@redhat.com> | 2011-05-12 00:11:36 +0800 |
---|---|---|
committer | Rodrigo Moya <rodrigo@gnome-db.org> | 2011-06-30 00:42:12 +0800 |
commit | 312d1b74ca0d2eedd92ead4945deaf9e746fd33b (patch) | |
tree | 12f81458239f2e1793eb752b1ca7fd9235600ff3 /mail | |
parent | d2efe18e83f5ac28d19afa506010910f752f670c (diff) | |
download | gsoc2013-evolution-312d1b74ca0d2eedd92ead4945deaf9e746fd33b.tar.gz gsoc2013-evolution-312d1b74ca0d2eedd92ead4945deaf9e746fd33b.tar.zst gsoc2013-evolution-312d1b74ca0d2eedd92ead4945deaf9e746fd33b.zip |
Remove mail_get_messages().
Use e_mail_folder_get_multiple_messages() instead.
Diffstat (limited to 'mail')
-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, |