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/mail-vfolder.c | |
parent | 61d1530c76341f1a69fa528071e3a6ffa07ed333 (diff) | |
download | gsoc2013-evolution-9692758dc5c3a03597f0eb0b16edd10134153823.tar gsoc2013-evolution-9692758dc5c3a03597f0eb0b16edd10134153823.tar.gz gsoc2013-evolution-9692758dc5c3a03597f0eb0b16edd10134153823.tar.bz2 gsoc2013-evolution-9692758dc5c3a03597f0eb0b16edd10134153823.tar.lz gsoc2013-evolution-9692758dc5c3a03597f0eb0b16edd10134153823.tar.xz 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/mail-vfolder.c')
-rw-r--r-- | mail/mail-vfolder.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/mail/mail-vfolder.c b/mail/mail-vfolder.c index e726433897..526e0ea1ad 100644 --- a/mail/mail-vfolder.c +++ b/mail/mail-vfolder.c @@ -805,13 +805,15 @@ rule_add_sources (EMailSession *session, static void rule_changed (EFilterRule *rule, CamelFolder *folder) { + EMailBackend *backend; EMailSession *session; GList *sources_uri = NULL, *sources_folder = NULL; GString *query; const gchar *full_name; full_name = camel_folder_get_full_name (folder); - session = em_vfolder_rule_get_session (EM_VFOLDER_RULE (rule)); + backend = em_vfolder_rule_get_backend (EM_VFOLDER_RULE (rule)); + session = e_mail_backend_get_session (backend); /* if the folder has changed name, then add it, then remove the old manually */ if (strcmp (full_name, rule->name) != 0) { @@ -1109,7 +1111,7 @@ vfolder_load_storage (EMailBackend *backend) /* load our rules */ user = g_build_filename (config_dir, "vfolders.xml", NULL); - context = em_vfolder_context_new (session); + context = em_vfolder_context_new (backend); xmlfile = g_build_filename (EVOLUTION_PRIVDATADIR, "vfoldertypes.xml", NULL); if (e_rule_context_load ((ERuleContext *) context, @@ -1345,12 +1347,12 @@ vfolder_create_part (const gchar *name) /* clones a filter/search rule into a matching vfolder rule * (assuming the same system definitions) */ EFilterRule * -vfolder_clone_rule (EMailSession *session, EFilterRule *in) +vfolder_clone_rule (EMailBackend *backend, EFilterRule *in) { EFilterRule *rule; xmlNodePtr xml; - rule = em_vfolder_rule_new (session); + rule = em_vfolder_rule_new (backend); xml = e_filter_rule_xml_encode (in); e_filter_rule_xml_decode (rule, xml, (ERuleContext *) context); |