aboutsummaryrefslogtreecommitdiffstats
path: root/camel
diff options
context:
space:
mode:
authorNot Zed <NotZed@Ximian.com>2004-02-09 19:46:35 +0800
committerMichael Zucci <zucchi@src.gnome.org>2004-02-09 19:46:35 +0800
commit6dd04ef03f9b900d8ee6e7d9e611fb368db6dd6e (patch)
treef07e31cd2494f91dd5cc9ebe806f265d5b8ee349 /camel
parentc4b9eb546503c11711704d88f7ffd311e6d95c74 (diff)
downloadgsoc2013-evolution-6dd04ef03f9b900d8ee6e7d9e611fb368db6dd6e.tar.gz
gsoc2013-evolution-6dd04ef03f9b900d8ee6e7d9e611fb368db6dd6e.tar.zst
gsoc2013-evolution-6dd04ef03f9b900d8ee6e7d9e611fb368db6dd6e.zip
** See bug #51319.
2004-02-09 Not Zed <NotZed@Ximian.com> ** See bug #51319. * providers/local/camel-local-folder.c (camel_local_folder_construct): re-enable indexing when folder is first opened. Also load defaults if no meta-data present. svn path=/trunk/; revision=24677
Diffstat (limited to 'camel')
-rw-r--r--camel/ChangeLog8
-rw-r--r--camel/camel-folder.c2
-rw-r--r--camel/providers/local/camel-local-folder.c18
3 files changed, 17 insertions, 11 deletions
diff --git a/camel/ChangeLog b/camel/ChangeLog
index fdf8a059cb..8beb93b3eb 100644
--- a/camel/ChangeLog
+++ b/camel/ChangeLog
@@ -1,3 +1,11 @@
+2004-02-09 Not Zed <NotZed@Ximian.com>
+
+ ** See bug #51319.
+
+ * providers/local/camel-local-folder.c
+ (camel_local_folder_construct): re-enable indexing when folder is
+ first opened. Also load defaults if no meta-data present.
+
2004-02-06 Jeffrey Stedfast <fejj@ximian.com>
* camel-provider.c (camel_provider_init): Use strrchr, not strchr.
diff --git a/camel/camel-folder.c b/camel/camel-folder.c
index 602f8afdd1..df585d6830 100644
--- a/camel/camel-folder.c
+++ b/camel/camel-folder.c
@@ -1549,7 +1549,6 @@ camel_folder_is_frozen (CamelFolder *folder)
return CF_CLASS (folder)->is_frozen (folder);
}
-
struct _folder_filter_msg {
CamelSessionThreadMsg msg;
@@ -1713,7 +1712,6 @@ message_changed (CamelObject *obj, /*const char *uid*/gpointer event_data)
return ret;
}
-
/**
* camel_folder_free_nop:
* @folder: a folder
diff --git a/camel/providers/local/camel-local-folder.c b/camel/providers/local/camel-local-folder.c
index ef1bcaf526..719d133645 100644
--- a/camel/providers/local/camel-local-folder.c
+++ b/camel/providers/local/camel-local-folder.c
@@ -255,7 +255,9 @@ camel_local_folder_construct(CamelLocalFolder *lf, CamelStore *parent_store, con
lf->flags = flags;
if (camel_object_state_read(lf) == -1) {
- /* FIXME: load defaults? */
+ /* No metadata - load defaults and persitify */
+ camel_object_set(lf, NULL, CAMEL_LOCAL_FOLDER_INDEX_BODY, TRUE, 0);
+ camel_object_state_write(lf);
}
/* follow any symlinks to the mailbox */
@@ -272,22 +274,22 @@ camel_local_folder_construct(CamelLocalFolder *lf, CamelStore *parent_store, con
unlink(lf->index_path);
/* FIXME: Need to run indexing off of the setv method */
-#if 1
- forceindex = FALSE;
-#else
+
/* if we have no/invalid index file, force it */
forceindex = camel_text_index_check(lf->index_path) == -1;
- if (flags & CAMEL_STORE_FOLDER_BODY_INDEX) {
+ if (lf->flags & CAMEL_STORE_FOLDER_BODY_INDEX) {
int flag = O_RDWR|O_CREAT;
+
if (forceindex)
flag |= O_TRUNC;
+
lf->index = (CamelIndex *)camel_text_index_new(lf->index_path, flag);
if (lf->index == NULL) {
/* yes, this isn't fatal at all */
g_warning("Could not open/create index file: %s: indexing not performed", strerror (errno));
forceindex = FALSE;
/* record that we dont have an index afterall */
- flags &= ~CAMEL_STORE_FOLDER_BODY_INDEX;
+ lf->flags &= ~CAMEL_STORE_FOLDER_BODY_INDEX;
}
} else {
/* if we do have an index file, remove it (?) */
@@ -295,8 +297,6 @@ camel_local_folder_construct(CamelLocalFolder *lf, CamelStore *parent_store, con
camel_text_index_remove(lf->index_path);
forceindex = FALSE;
}
- lf->flags = flags;
-#endif
folder->summary = (CamelFolderSummary *)CLOCALF_CLASS(lf)->create_summary(lf->summary_path, lf->folder_path, lf->index);
if (camel_local_summary_load((CamelLocalSummary *)folder->summary, forceindex, ex) == -1) {
@@ -497,7 +497,7 @@ local_sync(CamelFolder *folder, gboolean expunge, CamelException *ex)
{
CamelLocalFolder *lf = CAMEL_LOCAL_FOLDER(folder);
- d(printf("local sync, expunge=%s\n", expunge?"true":"false"));
+ d(printf("local sync '%s' , expunge=%s\n", folder->full_name, expunge?"true":"false"));
if (camel_local_folder_lock(lf, CAMEL_LOCK_WRITE, ex) == -1)
return;