diff options
author | Matthew Barnes <mbarnes@redhat.com> | 2011-08-18 10:20:50 +0800 |
---|---|---|
committer | Matthew Barnes <mbarnes@redhat.com> | 2011-08-18 10:27:46 +0800 |
commit | ef929f26973d8d5712a6962c804b1dc0b439d0a9 (patch) | |
tree | 2dec2dc401b93010d354bbf4c62bc5bf38bc8562 /mail/e-mail-store.c | |
parent | dd57574c0427b4571c1daac42b6ffa636a8c80c1 (diff) | |
download | gsoc2013-evolution-ef929f26973d8d5712a6962c804b1dc0b439d0a9.tar gsoc2013-evolution-ef929f26973d8d5712a6962c804b1dc0b439d0a9.tar.gz gsoc2013-evolution-ef929f26973d8d5712a6962c804b1dc0b439d0a9.tar.bz2 gsoc2013-evolution-ef929f26973d8d5712a6962c804b1dc0b439d0a9.tar.lz gsoc2013-evolution-ef929f26973d8d5712a6962c804b1dc0b439d0a9.tar.xz gsoc2013-evolution-ef929f26973d8d5712a6962c804b1dc0b439d0a9.tar.zst gsoc2013-evolution-ef929f26973d8d5712a6962c804b1dc0b439d0a9.zip |
e_mail_store_foreach(): Take an EMailSession parameter.
Use camel_session_list_services() instead of the internal store table.
The store table serves little purpose nowadays and could probably be
removed. I'll look into that later.
Diffstat (limited to 'mail/e-mail-store.c')
-rw-r--r-- | mail/e-mail-store.c | 27 |
1 files changed, 14 insertions, 13 deletions
diff --git a/mail/e-mail-store.c b/mail/e-mail-store.c index f9d18456b4..3a7c27e71c 100644 --- a/mail/e-mail-store.c +++ b/mail/e-mail-store.c @@ -419,25 +419,26 @@ e_mail_store_remove_by_account (EMailSession *session, } void -e_mail_store_foreach (GFunc func, +e_mail_store_foreach (EMailSession *session, + GFunc func, gpointer user_data) { - GHashTableIter iter; - gpointer store; + GList *list, *link; - g_return_if_fail (func != NULL); - - /* case when started in other than mailer component and closing evolution */ - if (!store_table) - return; + /* XXX This is a silly convenience function. + * Could probably just get rid of it. */ - g_hash_table_iter_init (&iter, store_table); + g_return_if_fail (E_IS_MAIL_SESSION (session)); + g_return_if_fail (func != NULL); - while (g_hash_table_iter_next (&iter, &store, NULL)) { + list = camel_session_list_services (CAMEL_SESSION (session)); - /* Just being paranoid. */ - g_return_if_fail (CAMEL_IS_STORE (store)); + for (link = list; link != NULL; link = g_list_next (link)) { + CamelService *service = CAMEL_SERVICE (link->data); - func (store, user_data); + if (CAMEL_IS_STORE (service)) + func (service, user_data); } + + g_list_free (list); } |