From c88d3170304e1892b221d0581a3cd3c767de4281 Mon Sep 17 00:00:00 2001 From: Milan Crha Date: Wed, 30 May 2012 18:46:49 +0200 Subject: Adapt to vFolder changes from evolution-data-server --- libemail-engine/mail-vfolder.c | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) (limited to 'libemail-engine') diff --git a/libemail-engine/mail-vfolder.c b/libemail-engine/mail-vfolder.c index aed9668c4c..dd083fafb8 100644 --- a/libemail-engine/mail-vfolder.c +++ b/libemail-engine/mail-vfolder.c @@ -108,7 +108,7 @@ vfolder_setup_exec (struct _setup_msg *m, } if (!vfolder_shutdown) - camel_vee_folder_set_folders ((CamelVeeFolder *) m->folder, list); + camel_vee_folder_set_folders ((CamelVeeFolder *) m->folder, list, cancellable); l = list; while (l) { @@ -128,6 +128,8 @@ vfolder_setup_free (struct _setup_msg *m) { GList *l; + camel_folder_thaw (m->folder); + g_object_unref (m->session); g_object_unref (m->folder); g_free (m->query); @@ -173,6 +175,8 @@ vfolder_setup (EMailSession *session, m->sources_uri = sources_uri; m->sources_folder = sources_folder; + camel_folder_freeze (m->folder); + id = m->base.seq; mail_msg_slow_ordered_push (m); @@ -254,9 +258,9 @@ vfolder_adduri_exec (struct _adduri_msg *m, while (l && !vfolder_shutdown) { if (m->remove) camel_vee_folder_remove_folder ( - CAMEL_VEE_FOLDER (l->data), folder); + CAMEL_VEE_FOLDER (l->data), folder, cancellable); else - camel_vee_folder_add_folder ((CamelVeeFolder *) l->data, folder); + camel_vee_folder_add_folder ((CamelVeeFolder *) l->data, folder, cancellable); l = l->next; } g_object_unref (folder); @@ -272,8 +276,8 @@ static void vfolder_adduri_free (struct _adduri_msg *m) { g_object_unref (m->session); - g_list_foreach (m->folders, (GFunc) g_object_unref, NULL); - g_list_free (m->folders); + g_list_foreach (m->folders, (GFunc) camel_folder_thaw, NULL); + g_list_free_full (m->folders, g_object_unref); g_free (m->uri); } @@ -301,6 +305,8 @@ vfolder_adduri (EMailSession *session, m->uri = g_strdup (uri); m->remove = remove; + g_list_foreach (m->folders, (GFunc) camel_folder_freeze, NULL); + id = m->base.seq; mail_msg_slow_ordered_push (m); @@ -877,10 +883,12 @@ store_folder_deleted_cb (CamelStore *store, gchar *user; d(printf("Folder deleted: %s\n", info->name)); - store = store; - /* Warning not thread safe, but might be enough */ + /* Unmatched folder doesn't have any rule */ + if (g_strcmp0 (CAMEL_UNMATCHED_NAME, info->full_name) == 0) + return; + /* Warning not thread safe, but might be enough */ G_LOCK (vfolder); /* delete it from our list */ -- cgit v1.2.3