aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--camel/ChangeLog19
-rw-r--r--camel/providers/local/camel-local-folder.c6
-rw-r--r--camel/providers/local/camel-local-summary.c21
-rw-r--r--camel/providers/local/camel-maildir-summary.c16
-rw-r--r--camel/providers/local/camel-mbox-summary.c20
-rw-r--r--camel/providers/local/camel-mh-summary.c11
6 files changed, 43 insertions, 50 deletions
diff --git a/camel/ChangeLog b/camel/ChangeLog
index bd836e916f..d9b398c703 100644
--- a/camel/ChangeLog
+++ b/camel/ChangeLog
@@ -1,5 +1,24 @@
2001-10-03 <NotZed@Ximian.com>
+ * providers/local/camel-local-folder.c (local_sync): Dont
+ explicitly save metadata, its saved in summary_sync.
+
+ * providers/local/camel-mh-summary.c: Call superclass.
+ (mh_summary_check): Dont save ibex.
+
+ * providers/local/camel-maildir-summary.c: Call superclass method.
+ (maildir_summary_check): Dont save ibex explictly.
+
+ * providers/local/camel-mbox-summary.c: Call super-class sync when
+ done, saves summary/ibex, etc.
+ (mbox_summary_check): Dont save ibex.
+ (mbox_summary_sync): Call summary_check rather than trying to
+ update from our known position.
+
+ * providers/local/camel-local-summary.c
+ (camel_local_summary_check): Dont save the summary or index here.
+ (local_summary_sync): Save the summary/index here.
+
* camel-search-private.c (camel_search_build_match_regex): Added
MATCH_NEWLINE flag, -> REG_NEWLINE.
diff --git a/camel/providers/local/camel-local-folder.c b/camel/providers/local/camel-local-folder.c
index 2e9e348695..c469c2578b 100644
--- a/camel/providers/local/camel-local-folder.c
+++ b/camel/providers/local/camel-local-folder.c
@@ -294,12 +294,6 @@ local_sync(CamelFolder *folder, gboolean expunge, CamelException *ex)
camel_object_trigger_event(CAMEL_OBJECT(folder), "folder_changed", lf->changes);
camel_folder_change_info_clear(lf->changes);
}
-
- /* force save of metadata */
- if (lf->index)
- ibex_save(lf->index);
- if (folder->summary)
- camel_folder_summary_save(folder->summary);
}
static void
diff --git a/camel/providers/local/camel-local-summary.c b/camel/providers/local/camel-local-summary.c
index 3202076520..1a201840e2 100644
--- a/camel/providers/local/camel-local-summary.c
+++ b/camel/providers/local/camel-local-summary.c
@@ -255,13 +255,6 @@ camel_local_summary_check(CamelLocalSummary *cls, CamelFolderChangeInfo *changei
ret = ((CamelLocalSummaryClass *)(CAMEL_OBJECT_GET_CLASS(cls)))->check(cls, changeinfo, ex);
- if (ret != -1) {
- if (camel_folder_summary_save((CamelFolderSummary *)cls) == -1)
- g_warning("Could not save summary for %s: %s", cls->folder_path, strerror(errno));
- if (cls->index && ibex_save(cls->index) == -1)
- g_warning("Could not sync index for %s: %s", cls->folder_path, strerror(errno));
- }
-
#ifdef DOSTATS
if (ret != -1) {
int i;
@@ -366,7 +359,19 @@ local_summary_check(CamelLocalSummary *cls, CamelFolderChangeInfo *changeinfo, C
static int
local_summary_sync(CamelLocalSummary *cls, gboolean expunge, CamelFolderChangeInfo *changeinfo, CamelException *ex)
{
- return 0;
+ int ret = 0;
+
+ ret = camel_folder_summary_save((CamelFolderSummary *)cls);
+ if (ret == -1) {
+ camel_exception_setv(ex, CAMEL_EXCEPTION_SYSTEM,
+ _("Could not save summary: %s: %s"), cls->folder_path, strerror(errno));
+ g_warning("Could not save summary for %s: %s", cls->folder_path, strerror(errno));
+ }
+
+ if (cls->index && ibex_save(cls->index) == -1)
+ g_warning("Could not sync index for %s: %s", cls->folder_path, strerror(errno));
+
+ return ret;
}
static CamelMessageInfo *
diff --git a/camel/providers/local/camel-maildir-summary.c b/camel/providers/local/camel-maildir-summary.c
index 39726566bc..6cc44a6772 100644
--- a/camel/providers/local/camel-maildir-summary.c
+++ b/camel/providers/local/camel-maildir-summary.c
@@ -661,15 +661,6 @@ maildir_summary_check(CamelLocalSummary *cls, CamelFolderChangeInfo *changes, Ca
qsort(s->messages->pdata, s->messages->len, sizeof(CamelMessageInfo *), sort_receive_cmp);
CAMEL_SUMMARY_UNLOCK(s, summary_lock);
- /* FIXME: move this up a class? */
-
- /* force a save of the index, just to make sure */
- /* note this could be expensive so possibly shouldn't be here
- as such */
- if (cls->index) {
- ibex_save(cls->index);
- }
-
return 0;
}
@@ -691,10 +682,6 @@ maildir_summary_sync(CamelLocalSummary *cls, gboolean expunge, CamelFolderChange
if (camel_local_summary_check(cls, changes, ex) == -1)
return -1;
- if (cls->index) {
- ibex_save(cls->index);
- }
-
count = camel_folder_summary_count((CamelFolderSummary *)cls);
for (i=count-1;i>=0;i--) {
info = camel_folder_summary_index((CamelFolderSummary *)cls, i);
@@ -760,6 +747,7 @@ maildir_summary_sync(CamelLocalSummary *cls, gboolean expunge, CamelFolderChange
}
camel_folder_summary_info_free((CamelFolderSummary *)cls, info);
}
- return 0;
+
+ return ((CamelLocalSummaryClass *)parent_class)->sync(cls, expunge, changes, ex);
}
diff --git a/camel/providers/local/camel-mbox-summary.c b/camel/providers/local/camel-mbox-summary.c
index 3d6dfc5378..89cc831b4a 100644
--- a/camel/providers/local/camel-mbox-summary.c
+++ b/camel/providers/local/camel-mbox-summary.c
@@ -399,15 +399,12 @@ mbox_summary_check(CamelLocalSummary *cls, CamelFolderChangeInfo *changes, Camel
/* FIXME: move upstream? */
if (ret != -1) {
- mbs->folder_size = st.st_size;
- s->time = st.st_mtime;
-#if 0
- /* this failing is not a fatal event */
- if (camel_folder_summary_save(s) == -1)
- g_warning("Could not save summary: %s", strerror(errno));
- if (cls->index)
- ibex_save(cls->index);
-#endif
+ if (mbs->folder_size != st.st_size
+ || s->time != st.st_mtime) {
+ mbs->folder_size = st.st_size;
+ s->time = st.st_mtime;
+ camel_folder_summary_touch(s);
+ }
}
return ret;
@@ -836,7 +833,7 @@ mbox_summary_sync(CamelLocalSummary *cls, gboolean expunge, CamelFolderChangeInf
int ret;
/* first, sync ourselves up, just to make sure */
- if (summary_update(cls, mbs->folder_size, changeinfo, ex) == -1)
+ if (camel_local_summary_check(cls, changeinfo, ex) == -1)
return -1;
count = camel_folder_summary_count(s);
@@ -882,7 +879,6 @@ mbox_summary_sync(CamelLocalSummary *cls, gboolean expunge, CamelFolderChangeInf
camel_folder_summary_touch(s);
s->time = st.st_mtime;
mbs->folder_size = st.st_size;
- camel_folder_summary_save(s);
- return 0;
+ return ((CamelLocalSummaryClass *)camel_mbox_summary_parent)->sync(cls, expunge, changeinfo, ex);
}
diff --git a/camel/providers/local/camel-mh-summary.c b/camel/providers/local/camel-mh-summary.c
index f2ba0c9393..4198818c11 100644
--- a/camel/providers/local/camel-mh-summary.c
+++ b/camel/providers/local/camel-mh-summary.c
@@ -263,15 +263,6 @@ mh_summary_check(CamelLocalSummary *cls, CamelFolderChangeInfo *changeinfo, Came
g_hash_table_foreach(left, (GHFunc)remove_summary, cls);
g_hash_table_destroy(left);
- /* FIXME: move this up a class */
-
- /* force a save of the index, just to make sure */
- /* note this could be expensive so possibly shouldn't be here
- as such */
- if (cls->index) {
- ibex_save(cls->index);
- }
-
return 0;
}
@@ -393,5 +384,5 @@ mh_summary_sync(CamelLocalSummary *cls, gboolean expunge, CamelFolderChangeInfo
camel_folder_summary_info_free((CamelFolderSummary *)cls, info);
}
- return 0;
+ return ((CamelLocalSummaryClass *)parent_class)->sync(cls, expunge, changes, ex);
}