diff options
author | Not Zed <NotZed@Ximian.com> | 2004-01-09 14:26:58 +0800 |
---|---|---|
committer | Michael Zucci <zucchi@src.gnome.org> | 2004-01-09 14:26:58 +0800 |
commit | 2481120809ca40d8675f85851214272a527e6298 (patch) | |
tree | b15379767c6b1e2515b3861bf341186e40bd5e00 /camel/providers/imap/camel-imap-folder.c | |
parent | efa0b9c96b5b3283dae60c8045ada5a89f817f4f (diff) | |
download | gsoc2013-evolution-2481120809ca40d8675f85851214272a527e6298.tar gsoc2013-evolution-2481120809ca40d8675f85851214272a527e6298.tar.gz gsoc2013-evolution-2481120809ca40d8675f85851214272a527e6298.tar.bz2 gsoc2013-evolution-2481120809ca40d8675f85851214272a527e6298.tar.lz gsoc2013-evolution-2481120809ca40d8675f85851214272a527e6298.tar.xz 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/imap/camel-imap-folder.c')
-rw-r--r-- | camel/providers/imap/camel-imap-folder.c | 18 |
1 files changed, 14 insertions, 4 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); |