aboutsummaryrefslogtreecommitdiffstats
path: root/camel/camel-vee-folder.c
diff options
context:
space:
mode:
authorNot Zed <NotZed@Ximian.com>2004-04-06 16:21:50 +0800
committerMichael Zucci <zucchi@src.gnome.org>2004-04-06 16:21:50 +0800
commitf24ee0c5c97a394027b636d639be56dec7a01fb6 (patch)
tree7527afe8a5733ef9ac56ff6db86e872c03479277 /camel/camel-vee-folder.c
parent9279a2cf22757bba12c54598963099c638504c80 (diff)
downloadgsoc2013-evolution-f24ee0c5c97a394027b636d639be56dec7a01fb6.tar.gz
gsoc2013-evolution-f24ee0c5c97a394027b636d639be56dec7a01fb6.tar.zst
gsoc2013-evolution-f24ee0c5c97a394027b636d639be56dec7a01fb6.zip
** See bug #56464.
2004-04-06 Not Zed <NotZed@Ximian.com> ** See bug #56464. * camel-folder.c (camel_folder_transfer_messages_to): do not lock the source here. (transfer_message_to): call the main entry point for get message and append message. ** See bug #56050. * camel-vee-store.c (vee_delete_folder): delete the state file if it exists. * camel-object.c (camel_object_state_write): create the parent dir if we need to. Also spit a warning if we fail in the end. * camel-vee-folder.c (camel_vee_folder_new): set the persistent state file location. (vee_sync): write the state file when we sync. svn path=/trunk/; revision=25331
Diffstat (limited to 'camel/camel-vee-folder.c')
-rw-r--r--camel/camel-vee-folder.c23
1 files changed, 16 insertions, 7 deletions
diff --git a/camel/camel-vee-folder.c b/camel/camel-vee-folder.c
index 1c246b3816..b937951962 100644
--- a/camel/camel-vee-folder.c
+++ b/camel/camel-vee-folder.c
@@ -213,7 +213,7 @@ vee_folder_construct (CamelVeeFolder *vf, CamelStore *parent_store, const char *
{
CamelFolder *folder = (CamelFolder *)vf;
char *tmp;
-
+
vf->flags = flags;
vf->vname = g_strdup(name);
tmp = strrchr(vf->vname, '/');
@@ -261,6 +261,7 @@ CamelFolder *
camel_vee_folder_new(CamelStore *parent_store, const char *name, guint32 flags)
{
CamelVeeFolder *vf;
+ char *tmp;
UNMATCHED_LOCK();
@@ -275,16 +276,22 @@ camel_vee_folder_new(CamelStore *parent_store, const char *name, guint32 flags)
UNMATCHED_UNLOCK();
if (strcmp(name, CAMEL_UNMATCHED_NAME) == 0) {
- camel_object_ref((CamelObject *)folder_unmatched);
- d(printf("returning unmatched %p, count = %d\n", folder_unmatched, camel_folder_get_message_count((CamelFolder *)folder_unmatched)));
- return (CamelFolder *)folder_unmatched;
+ vf = folder_unmatched;
+ camel_object_ref(vf);
+ } else {
+ vf = (CamelVeeFolder *)camel_object_new(camel_vee_folder_get_type());
+ vee_folder_construct(vf, parent_store, name, flags);
}
- vf = (CamelVeeFolder *)camel_object_new(camel_vee_folder_get_type());
- vee_folder_construct(vf, parent_store, name, flags);
-
d(printf("returning folder %s %p, count = %d\n", name, vf, camel_folder_get_message_count((CamelFolder *)vf)));
+ tmp = g_strdup_printf("%s/%s.cmeta", ((CamelService *)parent_store)->url->path, name);
+ camel_object_set(vf, NULL, CAMEL_OBJECT_STATE_FILE, tmp, NULL);
+ g_free(tmp);
+ if (camel_object_state_read(vf) == -1) {
+ /* setup defaults: we have none currently */
+ }
+
return (CamelFolder *)vf;
}
@@ -626,6 +633,8 @@ vee_sync(CamelFolder *folder, gboolean expunge, CamelException *ex)
}
CAMEL_VEE_FOLDER_UNLOCK(vf, subfolder_lock);
+
+ camel_object_state_write(vf);
}
static void