From 0d3da13635b50c5ab26d121c7dfe939713cc2f91 Mon Sep 17 00:00:00 2001 From: Srinivasa Ragavan Date: Mon, 28 Jan 2008 03:41:49 +0000 Subject: ** Fix for bug #511488 2008-01-24 Srinivasa Ragavan ** Fix for bug #511488 * em-folder-tree-model.c: (em_folder_tree_model_signal_block): * em-folder-tree-model.h: Function to block folder-created function. * mail-vfolder.c: (vfolder_load_storage): Block the signal handler when loading. svn path=/trunk/; revision=34905 --- mail/em-folder-tree-model.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'mail/em-folder-tree-model.c') diff --git a/mail/em-folder-tree-model.c b/mail/em-folder-tree-model.c index b394279d1b..7d174e8fbc 100644 --- a/mail/em-folder-tree-model.c +++ b/mail/em-folder-tree-model.c @@ -851,6 +851,23 @@ em_folder_tree_model_add_store (EMFolderTreeModel *model, CamelStore *store, con gtk_tree_path_free (path); } +void +em_folder_tree_model_signal_block (EMFolderTreeModel *model, CamelStore *store, gboolean block) +{ + struct _EMFolderTreeModelStoreInfo *si; + + si = g_hash_table_lookup (model->store_hash, store); + if (!si) + return; + + if (block) { + if (si->created_id) + camel_object_unhook_event (store, "folder_created", CAMEL_CALLBACK (folder_created_cb), model); + si->created_id = 0; + } else { + si->created_id = camel_object_hook_event (store, "folder_created", CAMEL_CALLBACK (folder_created_cb), model); + } +} static void em_folder_tree_model_remove_uri (EMFolderTreeModel *model, const char *uri) -- cgit