aboutsummaryrefslogtreecommitdiffstats
path: root/mail/e-mail-store.c
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2011-08-18 10:20:50 +0800
committerRodrigo Moya <rodrigo@gnome-db.org>2011-09-14 20:08:51 +0800
commit34be64ac5286f0a3e4c02a74ff0ef8c4062bb966 (patch)
tree76da094f0c521074d799f0b8e6e4644a12609abb /mail/e-mail-store.c
parent9b59286ea42a3db8b5d76f4e388b8691340b034c (diff)
downloadgsoc2013-evolution-34be64ac5286f0a3e4c02a74ff0ef8c4062bb966.tar
gsoc2013-evolution-34be64ac5286f0a3e4c02a74ff0ef8c4062bb966.tar.gz
gsoc2013-evolution-34be64ac5286f0a3e4c02a74ff0ef8c4062bb966.tar.bz2
gsoc2013-evolution-34be64ac5286f0a3e4c02a74ff0ef8c4062bb966.tar.lz
gsoc2013-evolution-34be64ac5286f0a3e4c02a74ff0ef8c4062bb966.tar.xz
gsoc2013-evolution-34be64ac5286f0a3e4c02a74ff0ef8c4062bb966.tar.zst
gsoc2013-evolution-34be64ac5286f0a3e4c02a74ff0ef8c4062bb966.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.c27
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);
}