From 7e4fb782fad1703aeda91745545af7b0fc01bed3 Mon Sep 17 00:00:00 2001 From: Jeffrey Stedfast Date: Tue, 27 Mar 2001 04:35:18 +0000 Subject: Move all of the camel_vee_folder_construct() internals here. 2001-03-26 Jeffrey Stedfast * camel-vee-folder.c (vee_folder_construct): Move all of the camel_vee_folder_construct() internals here. (camel_vee_folder_construct): This function basically becomes a wrapper for vee_folder_construct and also checks to make sure that the UNMATCHED vfodler is constructed otherwise constructs it. (camel_vee_folder_new): Call vee_folder_construct() instead so that we don't get into a dead-lock. svn path=/trunk/; revision=8964 --- camel/ChangeLog | 10 ++++++++++ camel/camel-vee-folder.c | 29 ++++++++++++++++++++++++----- 2 files changed, 34 insertions(+), 5 deletions(-) (limited to 'camel') diff --git a/camel/ChangeLog b/camel/ChangeLog index b4413e885f..adbea47d31 100644 --- a/camel/ChangeLog +++ b/camel/ChangeLog @@ -1,3 +1,13 @@ +2001-03-26 Jeffrey Stedfast + + * camel-vee-folder.c (vee_folder_construct): Move all of the + camel_vee_folder_construct() internals here. + (camel_vee_folder_construct): This function basically becomes a + wrapper for vee_folder_construct and also checks to make sure that + the UNMATCHED vfodler is constructed otherwise constructs it. + (camel_vee_folder_new): Call vee_folder_construct() instead so + that we don't get into a dead-lock. + 2001-03-26 Jeffrey Stedfast * camel-store.c (init_trash): Use camel_vtrash_folder_new() to diff --git a/camel/camel-vee-folder.c b/camel/camel-vee-folder.c index 1a54f8e657..f2045a6bab 100644 --- a/camel/camel-vee-folder.c +++ b/camel/camel-vee-folder.c @@ -191,12 +191,12 @@ camel_vee_folder_finalise (CamelObject *obj) g_free(p); } -void -camel_vee_folder_construct(CamelVeeFolder *vf, CamelStore *parent_store, const char *name, guint32 flags) +static void +vee_folder_construct (CamelVeeFolder *vf, CamelStore *parent_store, const char *name, guint32 flags) { CamelFolder *folder = (CamelFolder *)vf; char *tmp; - + vf->flags = flags; tmp = strchr(name, '?'); @@ -219,6 +219,25 @@ camel_vee_folder_construct(CamelVeeFolder *vf, CamelStore *parent_store, const c folder->summary->message_info_size = sizeof(CamelVeeMessageInfo); } +void +camel_vee_folder_construct(CamelVeeFolder *vf, CamelStore *parent_store, const char *name, guint32 flags) +{ + UNMATCHED_LOCK(); + + /* setup unmatched folder if we haven't yet */ + if (folder_unmatched == NULL) { + unmatched_uids = g_hash_table_new (g_str_hash, g_str_equal); + folder_unmatched = (CamelVeeFolder *)camel_object_new (camel_vee_folder_get_type ()); + printf("created foldeer unmatched %p\n", folder_unmatched); + + vee_folder_construct (folder_unmatched, parent_store, "UNMATCHED", CAMEL_STORE_FOLDER_PRIVATE); + } + + UNMATCHED_UNLOCK(); + + vee_folder_construct (vf, parent_store, name, flags); +} + /** * camel_vee_folder_new: * @parent_store: the parent CamelVeeStore @@ -242,7 +261,7 @@ camel_vee_folder_new(CamelStore *parent_store, const char *name, guint32 flags) unmatched_uids = g_hash_table_new(g_str_hash, g_str_equal); folder_unmatched = vf = (CamelVeeFolder *)camel_object_new(camel_vee_folder_get_type()); printf("created foldeer unmatched %p\n", folder_unmatched); - camel_vee_folder_construct(vf, parent_store, "UNMATCHED", CAMEL_STORE_FOLDER_PRIVATE); + vee_folder_construct (vf, parent_store, "UNMATCHED", CAMEL_STORE_FOLDER_PRIVATE); } UNMATCHED_UNLOCK(); @@ -260,7 +279,7 @@ camel_vee_folder_new(CamelStore *parent_store, const char *name, guint32 flags) } vf = (CamelVeeFolder *)camel_object_new(camel_vee_folder_get_type()); - camel_vee_folder_construct(vf, parent_store, name, flags); + vee_folder_construct(vf, parent_store, name, flags); printf("returning folder %s %p, count = %d\n", name, vf, camel_folder_get_message_count((CamelFolder *)vf)); -- cgit v1.2.3