aboutsummaryrefslogtreecommitdiffstats
path: root/mail/mail-vfolder.c
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2011-05-24 05:09:24 +0800
committerRodrigo Moya <rodrigo@gnome-db.org>2011-06-30 00:42:19 +0800
commit7050475f84247fb15e24aa1bb31502106c18815d (patch)
tree60e500f221d5f97b241045b10806c5c4ddbcc7c1 /mail/mail-vfolder.c
parenta98cb0a9820d2119bf10c317e5f6a9d56dd9073c (diff)
downloadgsoc2013-evolution-7050475f84247fb15e24aa1bb31502106c18815d.tar
gsoc2013-evolution-7050475f84247fb15e24aa1bb31502106c18815d.tar.gz
gsoc2013-evolution-7050475f84247fb15e24aa1bb31502106c18815d.tar.bz2
gsoc2013-evolution-7050475f84247fb15e24aa1bb31502106c18815d.tar.lz
gsoc2013-evolution-7050475f84247fb15e24aa1bb31502106c18815d.tar.xz
gsoc2013-evolution-7050475f84247fb15e24aa1bb31502106c18815d.tar.zst
gsoc2013-evolution-7050475f84247fb15e24aa1bb31502106c18815d.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.c10
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);