From 6d76cc84a11eff91e2bc66d6c1214e8226c9539a Mon Sep 17 00:00:00 2001 From: Ettore Perazzoli Date: Tue, 4 Jul 2000 03:40:58 +0000 Subject: Centralize creation of new UIDs for the summary. svn path=/trunk/; revision=3885 --- camel/camel-folder-summary.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'camel/camel-folder-summary.c') diff --git a/camel/camel-folder-summary.c b/camel/camel-folder-summary.c index 1d4352ed67..6ccf2bc7d5 100644 --- a/camel/camel-folder-summary.c +++ b/camel/camel-folder-summary.c @@ -269,6 +269,12 @@ guint32 camel_folder_summary_next_uid(CamelFolderSummary *s) return uid; } +char * +camel_folder_summary_next_uid_string (CamelFolderSummary *s) +{ + return g_strdup_printf ("%u", camel_folder_summary_next_uid (s)); +} + /* loads the content descriptions, recursively */ static CamelMessageContentInfo * perform_content_info_load(CamelFolderSummary *s, FILE *in) @@ -412,7 +418,7 @@ void camel_folder_summary_add(CamelFolderSummary *s, CamelMessageInfo *info) return; retry: if (info->uid == NULL) { - info->uid = g_strdup_printf("%u", s->nextuid++); + info->uid = camel_folder_summary_next_uid_string (s); } if (g_hash_table_lookup(s->messages_uid, info->uid)) { g_warning("Trying to insert message with clashing uid. new uid re-assigned"); @@ -453,7 +459,7 @@ CamelMessageInfo *camel_folder_summary_add_from_parser(CamelFolderSummary *s, Ca /* FIXME: better uid assignment method? */ if (info->uid == NULL) { - info->uid = g_strdup_printf("%u", s->nextuid++); + info->uid = camel_folder_summary_next_uid_string (s); } if (p->index) { -- cgit v1.2.3