From a9cfed5938aef37d95c009411f965ebc185547c1 Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Fri, 16 Dec 2011 10:40:37 -0500 Subject: Avoid passing EMailBackend as much as possible. More mail API churn... reversing some previous API decisions. I've made some key API changes to EMailSession on the account-mgmt branch which should allow for this, and will hopefully also benefit the "email-factory" branch. EMailBackend barely needs to exist anymore, except as the owner of EMailSession. For several low-level functions, we replace its EMailBackend parameter with EMailSession and EAlertSink parameters; the latter so it can still pass user alerts up the chain. --- mail/e-mail-session.c | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) (limited to 'mail/e-mail-session.c') diff --git a/mail/e-mail-session.c b/mail/e-mail-session.c index 24fd0be3ef..11bdf87b8d 100644 --- a/mail/e-mail-session.c +++ b/mail/e-mail-session.c @@ -345,8 +345,6 @@ main_get_filter_driver (CamelSession *session, const gchar *type, GError **error) { - EShell *shell; - EShellBackend *shell_backend; EMailSession *ms = E_MAIL_SESSION (session); CamelFilterDriver *driver; EFilterRule *rule = NULL; @@ -355,17 +353,12 @@ main_get_filter_driver (CamelSession *session, GSettings *settings; ERuleContext *fc; - shell = e_shell_get_default (); - shell_backend = e_shell_get_backend_by_name (shell, "mail"); - g_return_val_if_fail (E_IS_MAIL_BACKEND (shell_backend), NULL); - settings = g_settings_new ("org.gnome.evolution.mail"); config_dir = mail_session_get_config_dir (); user = g_build_filename (config_dir, "filters.xml", NULL); system = g_build_filename (EVOLUTION_PRIVDATADIR, "filtertypes.xml", NULL); - fc = (ERuleContext *) em_filter_context_new ( - E_MAIL_BACKEND (shell_backend)); + fc = (ERuleContext *) em_filter_context_new (ms); e_rule_context_load (fc, system, user); g_free (system); g_free (user); @@ -446,17 +439,10 @@ static guint preparing_flush = 0; static gboolean forward_to_flush_outbox_cb (EMailSession *session) { - EShell *shell; - EShellBackend *shell_backend; - g_return_val_if_fail (preparing_flush != 0, FALSE); - shell = e_shell_get_default (); - shell_backend = e_shell_get_backend_by_name (shell, "mail"); - g_return_val_if_fail (E_IS_MAIL_BACKEND (shell_backend), FALSE); - preparing_flush = 0; - mail_send (E_MAIL_BACKEND (shell_backend)); + mail_send (session); return FALSE; } -- cgit v1.2.3