aboutsummaryrefslogtreecommitdiffstats
path: root/camel/providers
diff options
context:
space:
mode:
authorNot Zed <NotZed@Ximian.com>2004-01-09 14:26:58 +0800
committerMichael Zucci <zucchi@src.gnome.org>2004-01-09 14:26:58 +0800
commit2481120809ca40d8675f85851214272a527e6298 (patch)
treeb15379767c6b1e2515b3861bf341186e40bd5e00 /camel/providers
parentefa0b9c96b5b3283dae60c8045ada5a89f817f4f (diff)
downloadgsoc2013-evolution-2481120809ca40d8675f85851214272a527e6298.tar.gz
gsoc2013-evolution-2481120809ca40d8675f85851214272a527e6298.tar.zst
gsoc2013-evolution-2481120809ca40d8675f85851214272a527e6298.zip
fix removal of journal file, and remove the cmeta state file too.
2004-01-09 Not Zed <NotZed@Ximian.com> * providers/imap/camel-imap-store.c (imap_forget_folder): fix removal of journal file, and remove the cmeta state file too. * providers/imap/camel-imap-folder.c (imap_getv): count up so we call parent class if we missed any, rather than only if we didn't miss any. (imap_rename): rename the object state file. (camel_imap_folder_new): set the object state file for persistent properties. * camel-disco-folder.c (disco_getv): support (PERSISTENT_)PROPERTIES & OFFLINE_SYNC. (disco_setv): implement OFFLINE_SYNC. (camel_disco_folder_get_type): setup disco properties list. (cdf_folder_changed): honour the offline_sync setting on the current folder. (disco_sync): save object state. (disco_setv): save object state if it changed. svn path=/trunk/; revision=24126
Diffstat (limited to 'camel/providers')
-rw-r--r--camel/providers/imap/camel-imap-folder.c18
-rw-r--r--camel/providers/imap/camel-imap-folder.h5
-rw-r--r--camel/providers/imap/camel-imap-store.c8
3 files changed, 23 insertions, 8 deletions
diff --git a/camel/providers/imap/camel-imap-folder.c b/camel/providers/imap/camel-imap-folder.c
index 4db0c7a43f..a4c40c6635 100644
--- a/camel/providers/imap/camel-imap-folder.c
+++ b/camel/providers/imap/camel-imap-folder.c
@@ -216,7 +216,7 @@ camel_imap_folder_new (CamelStore *parent, const char *folder_name,
CamelFolder *folder;
CamelImapFolder *imap_folder;
const char *short_name;
- char *summary_file;
+ char *summary_file, *state_file;
if (camel_mkdir (folder_dir, S_IRWXU) != 0) {
camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
@@ -244,6 +244,12 @@ camel_imap_folder_new (CamelStore *parent, const char *folder_name,
return NULL;
}
+ /* set/load persistent state */
+ state_file = g_strdup_printf ("%s/cmeta", folder_dir);
+ camel_object_set(folder, NULL, CAMEL_OBJECT_STATE_FILE, state_file, NULL);
+ g_free(state_file);
+ camel_object_state_read(folder);
+
imap_folder = CAMEL_IMAP_FOLDER (folder);
imap_folder->cache = camel_imap_message_cache_new (folder_dir, folder->summary, ex);
if (!imap_folder->cache) {
@@ -406,7 +412,7 @@ static int
imap_getv(CamelObject *object, CamelException *ex, CamelArgGetV *args)
{
CamelFolder *folder = (CamelFolder *)object;
- int i, count=args->argc;
+ int i, count=0;
guint32 tag;
for (i=0;i<args->argc;i++) {
@@ -426,7 +432,7 @@ imap_getv(CamelObject *object, CamelException *ex, CamelArgGetV *args)
*arg->ca_str = folder->description;
break;
default:
- count--;
+ count++;
continue;
}
@@ -444,7 +450,7 @@ imap_rename (CamelFolder *folder, const char *new)
{
CamelImapFolder *imap_folder = (CamelImapFolder *)folder;
CamelImapStore *imap_store = (CamelImapStore *)folder->parent_store;
- char *folder_dir, *summary_path;
+ char *folder_dir, *summary_path, *state_file;
char *folders;
folders = g_strconcat (imap_store->storage_path, "/folders", NULL);
@@ -458,6 +464,10 @@ imap_rename (CamelFolder *folder, const char *new)
camel_folder_summary_set_filename(folder->summary, summary_path);
+ state_file = g_strdup_printf ("%s/cmeta", folder_dir);
+ camel_object_set(folder, NULL, CAMEL_OBJECT_STATE_FILE, state_file, NULL);
+ g_free(state_file);
+
g_free(summary_path);
g_free(folder_dir);
diff --git a/camel/providers/imap/camel-imap-folder.h b/camel/providers/imap/camel-imap-folder.h
index a49f7bd497..4cadebc65b 100644
--- a/camel/providers/imap/camel-imap-folder.h
+++ b/camel/providers/imap/camel-imap-folder.h
@@ -47,11 +47,12 @@ struct _CamelImapFolder {
struct _CamelImapFolderPrivate *priv;
- gboolean need_rescan, need_refresh;
CamelFolderSearch *search;
CamelImapMessageCache *cache;
-};
+ unsigned int need_rescan:1;
+ unsigned int need_refresh:1;
+};
typedef struct {
CamelDiscoFolderClass parent_class;
diff --git a/camel/providers/imap/camel-imap-store.c b/camel/providers/imap/camel-imap-store.c
index 4b4250da18..d8ff6e0ec7 100644
--- a/camel/providers/imap/camel-imap-store.c
+++ b/camel/providers/imap/camel-imap-store.c
@@ -1042,7 +1042,7 @@ imap_forget_folder (CamelImapStore *imap_store, const char *folder_name, CamelEx
{
CamelFolderSummary *summary;
CamelImapMessageCache *cache;
- char *summary_file;
+ char *summary_file, *state_file;
char *journal_file;
char *folder_dir, *storage_path;
CamelFolderInfo *fi;
@@ -1080,9 +1080,13 @@ imap_forget_folder (CamelImapStore *imap_store, const char *folder_name, CamelEx
unlink (summary_file);
g_free (summary_file);
- journal_file = g_strdup_printf ("%s/summary", folder_dir);
+ journal_file = g_strdup_printf ("%s/journal", folder_dir);
unlink (journal_file);
g_free (journal_file);
+
+ state_file = g_strdup_printf ("%s/cmeta", folder_dir);
+ unlink (state_file);
+ g_free (state_file);
rmdir (folder_dir);
g_free (folder_dir);