diff options
author | Matthew Barnes <mbarnes@redhat.com> | 2011-12-16 23:40:37 +0800 |
---|---|---|
committer | Matthew Barnes <mbarnes@redhat.com> | 2011-12-16 23:58:54 +0800 |
commit | a9cfed5938aef37d95c009411f965ebc185547c1 (patch) | |
tree | d0c6eb1d5acea6752425169aae47e8f4ed4b55ea /mail/e-mail-session.c | |
parent | df85cb1b7a47f713cb775f648f735e642a1bb71b (diff) | |
download | gsoc2013-evolution-a9cfed5938aef37d95c009411f965ebc185547c1.tar gsoc2013-evolution-a9cfed5938aef37d95c009411f965ebc185547c1.tar.gz gsoc2013-evolution-a9cfed5938aef37d95c009411f965ebc185547c1.tar.bz2 gsoc2013-evolution-a9cfed5938aef37d95c009411f965ebc185547c1.tar.lz gsoc2013-evolution-a9cfed5938aef37d95c009411f965ebc185547c1.tar.xz gsoc2013-evolution-a9cfed5938aef37d95c009411f965ebc185547c1.tar.zst gsoc2013-evolution-a9cfed5938aef37d95c009411f965ebc185547c1.zip |
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.
Diffstat (limited to 'mail/e-mail-session.c')
-rw-r--r-- | mail/e-mail-session.c | 18 |
1 files changed, 2 insertions, 16 deletions
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; } |