aboutsummaryrefslogtreecommitdiffstats
path: root/camel
diff options
context:
space:
mode:
Diffstat (limited to 'camel')
-rw-r--r--camel/ChangeLog10
-rw-r--r--camel/camel-vee-folder.c29
2 files changed, 34 insertions, 5 deletions
diff --git a/camel/ChangeLog b/camel/ChangeLog
index b4413e885f..adbea47d31 100644
--- a/camel/ChangeLog
+++ b/camel/ChangeLog
@@ -1,5 +1,15 @@
2001-03-26 Jeffrey Stedfast <fejj@ximian.com>
+ * 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 <fejj@ximian.com>
+
* camel-store.c (init_trash): Use camel_vtrash_folder_new() to
create the vtrash folder now.
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));