From a06e4484b8df804124b5bcf88d94dec5acfba270 Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Wed, 6 Oct 2010 23:38:52 -0400 Subject: 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. --- modules/mail/e-mail-shell-settings.c | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) (limited to 'modules/mail/e-mail-shell-settings.c') diff --git a/modules/mail/e-mail-shell-settings.c b/modules/mail/e-mail-shell-settings.c index 690a0ef5b8..5452a1939a 100644 --- a/modules/mail/e-mail-shell-settings.c +++ b/modules/mail/e-mail-shell-settings.c @@ -24,18 +24,28 @@ #include #include -#include "e-util/e-signature-list.h" -#include "mail/e-mail-label-list-store.h" -#include "mail/mail-session.h" +#include + +#include +#include + +#include void -e_mail_shell_settings_init (EShell *shell) +e_mail_shell_settings_init (EShellBackend *shell_backend) { + EShell *shell; EShellSettings *shell_settings; + EMailBackend *backend; + EMailSession *session; gpointer object; + shell = e_shell_backend_get_shell (shell_backend); shell_settings = e_shell_get_shell_settings (shell); + backend = E_MAIL_BACKEND (shell_backend); + session = e_mail_backend_get_session (backend); + /*** Global Objects ***/ e_shell_settings_install_property ( @@ -58,9 +68,9 @@ e_mail_shell_settings_init (EShell *shell) NULL, G_PARAM_READWRITE)); - g_object_ref (session); e_shell_settings_set_pointer ( - shell_settings, "mail-session", session); + shell_settings, "mail-session", + g_object_ref (session)); /*** Mail Preferences ***/ -- cgit v1.2.3