diff options
author | Matthew Barnes <mbarnes@redhat.com> | 2011-05-24 05:09:24 +0800 |
---|---|---|
committer | Matthew Barnes <mbarnes@redhat.com> | 2011-05-24 09:50:50 +0800 |
commit | 9692758dc5c3a03597f0eb0b16edd10134153823 (patch) | |
tree | ae48699ccfd792672b0b3c4e382fbc5ce13eb584 /mail/e-mail-session.c | |
parent | 61d1530c76341f1a69fa528071e3a6ffa07ed333 (diff) | |
download | gsoc2013-evolution-9692758dc5c3a03597f0eb0b16edd10134153823.tar.gz gsoc2013-evolution-9692758dc5c3a03597f0eb0b16edd10134153823.tar.zst gsoc2013-evolution-9692758dc5c3a03597f0eb0b16edd10134153823.zip |
EMFolderTree: Store an EMailBackend instead of an EMailSession.
All this so EMFolderTree can submit EActivity instances for async ops.
You can obtain an EMailSession from an EMailBackend, but not vice versa.
Creates lots of pretty ripples in the mail code, but ultimately reduces
complexity. So it's a code cleanup of sorts.
Diffstat (limited to 'mail/e-mail-session.c')
-rw-r--r-- | mail/e-mail-session.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/mail/e-mail-session.c b/mail/e-mail-session.c index b89e571c59..05f0fa09b9 100644 --- a/mail/e-mail-session.c +++ b/mail/e-mail-session.c @@ -289,6 +289,8 @@ 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; @@ -297,12 +299,17 @@ main_get_filter_driver (CamelSession *session, GConfClient *client; 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); + client = gconf_client_get_default (); 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 (ms); + fc = (ERuleContext *) em_filter_context_new ( + E_MAIL_BACKEND (shell_backend)); e_rule_context_load (fc, system, user); g_free (system); g_free (user); |