From 9692758dc5c3a03597f0eb0b16edd10134153823 Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Mon, 23 May 2011 17:09:24 -0400 Subject: 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. --- mail/mail-vfolder.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'mail/mail-vfolder.c') 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); -- cgit v1.2.3