diff options
author | Matthew Barnes <mbarnes@redhat.com> | 2010-10-07 11:38:52 +0800 |
---|---|---|
committer | Matthew Barnes <mbarnes@redhat.com> | 2010-10-13 01:58:59 +0800 |
commit | a06e4484b8df804124b5bcf88d94dec5acfba270 (patch) | |
tree | 4fa42793d7dc461f2b3767296d76592182c48222 /mail/e-mail-local.c | |
parent | 5e0758bb6934a7859b1d8a247c8fb21c156772cf (diff) | |
download | gsoc2013-evolution-a06e4484b8df804124b5bcf88d94dec5acfba270.tar gsoc2013-evolution-a06e4484b8df804124b5bcf88d94dec5acfba270.tar.gz gsoc2013-evolution-a06e4484b8df804124b5bcf88d94dec5acfba270.tar.bz2 gsoc2013-evolution-a06e4484b8df804124b5bcf88d94dec5acfba270.tar.lz gsoc2013-evolution-a06e4484b8df804124b5bcf88d94dec5acfba270.tar.xz gsoc2013-evolution-a06e4484b8df804124b5bcf88d94dec5acfba270.tar.zst gsoc2013-evolution-a06e4484b8df804124b5bcf88d94dec5acfba270.zip |
Give MailSession a permanent home.
Global variables in shared libraries are a bad idea. EMailBackend now
owns the MailSession instance, which is actually now EMailSession.
Move the blocking utility functions in mail-tools.c to e-mail-session.c
and add asynchronous variants. Same approach as Camel.
Replace EMailReader.get_shell_backend() with EMailReader.get_backend(),
which returns an EMailBackend. Easier access to the EMailSession.
Diffstat (limited to 'mail/e-mail-local.c')
-rw-r--r-- | mail/e-mail-local.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/mail/e-mail-local.c b/mail/e-mail-local.c index 861ac8fe35..1e7e66d942 100644 --- a/mail/e-mail-local.c +++ b/mail/e-mail-local.c @@ -23,8 +23,6 @@ #include <glib/gi18n.h> -#include "mail/mail-session.h" - #define CHECK_LOCAL_FOLDER_TYPE(type) \ ((type) < G_N_ELEMENTS (default_local_folders)) @@ -45,7 +43,8 @@ static struct { static CamelStore *local_store; void -e_mail_local_init (const gchar *data_dir) +e_mail_local_init (EMailSession *session, + const gchar *data_dir) { static gboolean initialized = FALSE; CamelService *service; @@ -55,6 +54,7 @@ e_mail_local_init (const gchar *data_dir) GError *local_error = NULL; g_return_if_fail (!initialized); + g_return_if_fail (E_IS_MAIL_SESSION (session)); g_return_if_fail (data_dir != NULL); url = camel_url_new ("mbox:", NULL); @@ -64,7 +64,8 @@ e_mail_local_init (const gchar *data_dir) temp = camel_url_to_string (url, 0); service = camel_session_get_service ( - session, temp, CAMEL_PROVIDER_STORE, &local_error); + CAMEL_SESSION (session), temp, + CAMEL_PROVIDER_STORE, &local_error); g_free (temp); if (local_error != NULL) |