From 7d17dc2230c4a3b650849ad6e2dcdc5ebf6cb47e Mon Sep 17 00:00:00 2001 From: Michael Zucci Date: Fri, 21 Sep 2001 03:05:03 +0000 Subject: New function to just load the summary. Not much use yet, until unread * camel-folder-summary.c (camel_folder_summary_header_load): New function to just load the summary. Not much use yet, until unread counts are stored in the summary (which now looks like too much work!). * camel-mime-utils.c (header_decode_mailbox): Crappy fix for stupid mailers. If we get 'name b. name ' then treat it as '"name b. name" '. See 8147. (header_decode_mailbox): Another fix for really broken mailers that have things that look like addresses followed by
bits. (rfc2047_encode_word): Escape ??= to avoid some bizarre warning about trigraphs. (scan_dir): If we dont have the folder open, then scan the 'new' and 'cur' folders for new and unread messages to count instead. svn path=/trunk/; revision=13040 --- camel/camel-folder-summary.c | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) (limited to 'camel/camel-folder-summary.c') diff --git a/camel/camel-folder-summary.c b/camel/camel-folder-summary.c index ac525dd619..f5f2131fa2 100644 --- a/camel/camel-folder-summary.c +++ b/camel/camel-folder-summary.c @@ -658,6 +658,36 @@ camel_folder_summary_save(CamelFolderSummary *s) return 0; } +/** + * camel_folder_summary_header_load: + * @s: Summary object. + * + * Only load the header information from the summary, + * keep the rest on disk. This should only be done on + * a fresh summary object. + * + * Return value: -1 on error. + **/ +int camel_folder_summary_header_load(CamelFolderSummary *s) +{ + FILE *in; + int ret; + + g_assert(s->summary_path); + + in = fopen(s->summary_path, "r"); + if (in == NULL) + return -1; + + CAMEL_SUMMARY_LOCK(s, io_lock); + ret = ((CamelFolderSummaryClass *)(CAMEL_OBJECT_GET_CLASS(s)))->summary_header_load(s, in); + CAMEL_SUMMARY_UNLOCK(s, io_lock); + + fclose(in); + s->flags &= ~CAMEL_SUMMARY_DIRTY; + return ret; +} + static void summary_assign_uid(CamelFolderSummary *s, CamelMessageInfo *info) { -- cgit v1.2.3