From de8e7223eac6c40b10d2a095210d2120aa97fa55 Mon Sep 17 00:00:00 2001 From: bertrand Date: Thu, 20 Jan 2000 03:02:13 +0000 Subject: implemented. 2000-01-19 bertrand * camel/providers/mbox/camel-mbox-folder.c (_get_message_count): implemented. * camel/providers/mbox/camel-mbox-summary.c (camel_mbox_save_summary): (camel_mbox_load_summary): save/load the next uid. * camel/providers/mbox/camel-mbox-parser.c (camel_mbox_parse_file): Compute the next available uid. * camel/providers/mbox/camel-mbox-folder.c (_create): (_check_get_or_maybe_generate_summary_file): Set and use the next_uid field properly. * camel/providers/mbox/camel-mbox-summary.h: added an extra field to store the next available uid. * camel/providers/mbox/camel-mbox-folder.c (_check_get_or_maybe_generate_summary_file): routine called when the folder is opened. Reads or creates the summary file. (_create): initialize the internal summary structure. (_close): save the summary file on closing. (_init_with_store): initialize mbox specific folder members. svn path=/trunk/; revision=1597 --- camel/providers/mbox/camel-mbox-parser.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'camel/providers/mbox/camel-mbox-parser.c') diff --git a/camel/providers/mbox/camel-mbox-parser.c b/camel/providers/mbox/camel-mbox-parser.c index 7503470426..63c79a48e1 100644 --- a/camel/providers/mbox/camel-mbox-parser.c +++ b/camel/providers/mbox/camel-mbox-parser.c @@ -561,6 +561,7 @@ GArray * camel_mbox_parse_file (int fd, const gchar *message_delimiter, glong start_position, + guint32 *next_uid, gboolean get_message_summary, camel_mbox_preparser_status_callback *status_callback, double status_interval, @@ -577,8 +578,11 @@ camel_mbox_parse_file (int fd, gboolean newline; GArray *return_value; gchar *x_ev_header_content; + guint32 next_available_uid = 1; + g_assert (next_uid); + /* get file size */ fstat_result = fstat (fd, &stat_buf); if (fstat_result == -1) { @@ -720,11 +724,8 @@ camel_mbox_parse_file (int fd, G_STRUCT_OFFSET (CamelMboxPreParser, current_message_info) + G_STRUCT_OFFSET (CamelMboxParserMessageInfo, status))); g_free (x_ev_header_content); - - /* - parser->current_message_info.x_evolution_length = - parser->real_position - parser->current_message_info.x_evolution_position; - */ + next_available_uid = MAX (next_available_uid, parser->current_message_info.uid); + newline = TRUE; continue; } @@ -760,7 +761,7 @@ camel_mbox_parse_file (int fd, } return_value = parser->preparsed_messages; - + *next_uid = next_available_uid; /* free the parser */ parser_free (parser); -- cgit v1.2.3