diff options
author | 3 <NotZed@Ximian.com> | 2001-10-04 07:05:06 +0800 |
---|---|---|
committer | Michael Zucci <zucchi@src.gnome.org> | 2001-10-04 07:05:06 +0800 |
commit | a39364e258908a69c25dc890788203b2663263f6 (patch) | |
tree | 7b2eca4adb86d98f7db1fbd9ae93a4ec5629c104 /camel | |
parent | e1b24ec26abf19d4c9bd40258b5157c5f4d7f691 (diff) | |
download | gsoc2013-evolution-a39364e258908a69c25dc890788203b2663263f6.tar gsoc2013-evolution-a39364e258908a69c25dc890788203b2663263f6.tar.gz gsoc2013-evolution-a39364e258908a69c25dc890788203b2663263f6.tar.bz2 gsoc2013-evolution-a39364e258908a69c25dc890788203b2663263f6.tar.lz gsoc2013-evolution-a39364e258908a69c25dc890788203b2663263f6.tar.xz gsoc2013-evolution-a39364e258908a69c25dc890788203b2663263f6.tar.zst gsoc2013-evolution-a39364e258908a69c25dc890788203b2663263f6.zip |
Dont explicitly save metadata, its saved in summary_sync.
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.
svn path=/trunk/; revision=13397
Diffstat (limited to 'camel')
-rw-r--r-- | camel/ChangeLog | 19 | ||||
-rw-r--r-- | camel/providers/local/camel-local-folder.c | 6 | ||||
-rw-r--r-- | camel/providers/local/camel-local-summary.c | 21 | ||||
-rw-r--r-- | camel/providers/local/camel-maildir-summary.c | 16 | ||||
-rw-r--r-- | camel/providers/local/camel-mbox-summary.c | 20 | ||||
-rw-r--r-- | camel/providers/local/camel-mh-summary.c | 11 |
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); } |