From cb13084bc24c04b16af88744f6eb67ae7f779018 Mon Sep 17 00:00:00 2001 From: Michael Zucci Date: Thu, 11 May 2000 20:46:13 +0000 Subject: > * providers/mbox/camel-mbox-folder.c (message_changed): Indicate > the summary changed also. > > (camel_mbox_summary_update): Also save summary when done. > (camel_mbox_summary_expunge): Unindex items when deleting them. > (camel_mbox_summary_expunge): Save the index as well as the > summary. > (camel_folder_summary_touch): New function, indicate the summary > info changed. > (camel_folder_summary_remove): Dirty here. svn path=/trunk/; revision=2994 --- camel/providers/mbox/camel-mbox-summary.c | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) (limited to 'camel/providers/mbox/camel-mbox-summary.c') diff --git a/camel/providers/mbox/camel-mbox-summary.c b/camel/providers/mbox/camel-mbox-summary.c index ead844ee66..56ff1cb198 100644 --- a/camel/providers/mbox/camel-mbox-summary.c +++ b/camel/providers/mbox/camel-mbox-summary.c @@ -323,8 +323,23 @@ summary_rebuild(CamelMboxSummary *mbs, off_t offset) int camel_mbox_summary_update(CamelMboxSummary *mbs, off_t offset) { + int ret; + mbs->index_force = FALSE; - return summary_rebuild(mbs, offset); + ret = summary_rebuild(mbs, offset); + +#if 0 +#warning "Saving full summary and index after every summarisation is slow ..." + if (ret != -1) { + if (camel_folder_summary_save((CamelFolderSummary *)mbs) == -1) + g_warning("Could not save summary: %s", strerror(errno)); + printf("summary saved\n"); + if (mbs->index) + ibex_save(mbs->index); + printf("ibex saved\n"); + } +#endif + return ret; } int @@ -581,6 +596,8 @@ camel_mbox_summary_expunge(CamelMboxSummary *mbs) g_assert(!quick); offset -= (info->info.content->endpos - info->frompos); + if (mbs->index) + ibex_unindex(mbs->index, info->info.uid); camel_folder_summary_remove(s, (CamelMessageInfo *)info); count--; i--; @@ -690,6 +707,8 @@ camel_mbox_summary_expunge(CamelMboxSummary *mbs) s->time = st.st_mtime; mbs->folder_size = st.st_size; camel_folder_summary_save(s); + if (mbs->index) + ibex_save(mbs->index); } gtk_object_unref((GtkObject *)mp); -- cgit v1.2.3