diff options
author | Ettore Perazzoli <ettore@src.gnome.org> | 2000-07-04 11:40:58 +0800 |
---|---|---|
committer | Ettore Perazzoli <ettore@src.gnome.org> | 2000-07-04 11:40:58 +0800 |
commit | 6d76cc84a11eff91e2bc66d6c1214e8226c9539a (patch) | |
tree | 6787ab7bb1dbe23402ec25c479273c21f3bda9d0 /camel | |
parent | c9974759b3e9abbe2c649966095f544441f02f8b (diff) | |
download | gsoc2013-evolution-6d76cc84a11eff91e2bc66d6c1214e8226c9539a.tar.gz gsoc2013-evolution-6d76cc84a11eff91e2bc66d6c1214e8226c9539a.tar.zst gsoc2013-evolution-6d76cc84a11eff91e2bc66d6c1214e8226c9539a.zip |
Centralize creation of new UIDs for the summary.
svn path=/trunk/; revision=3885
Diffstat (limited to 'camel')
-rw-r--r-- | camel/ChangeLog | 9 | ||||
-rw-r--r-- | camel/camel-folder-summary.c | 10 | ||||
-rw-r--r-- | camel/camel-folder-summary.h | 3 |
3 files changed, 19 insertions, 3 deletions
diff --git a/camel/ChangeLog b/camel/ChangeLog index c7575b5f5d..076c57e321 100644 --- a/camel/ChangeLog +++ b/camel/ChangeLog @@ -1,5 +1,14 @@ 2000-07-03 Ettore Perazzoli <ettore@helixcode.com> + * camel-folder-summary.c (camel_folder_summary_next_uid_string): + New. + (camel_folder_summary_add): Use + `camel_folder_summary_next_uid_string()' instead of recomputing + the UID manually here. + (camel_folder_summary_add_from_parser): Likewise. + +2000-07-03 Ettore Perazzoli <ettore@helixcode.com> + * camel-folder-summary.c (camel_folder_summary_set_uid): Removed. 2000-07-03 Dan Winship <danw@helixcode.com> 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) { diff --git a/camel/camel-folder-summary.h b/camel/camel-folder-summary.h index ef2b036e9e..b53d645ad6 100644 --- a/camel/camel-folder-summary.h +++ b/camel/camel-folder-summary.h @@ -162,7 +162,8 @@ void camel_folder_summary_set_filename(CamelFolderSummary *, const char *); void camel_folder_summary_set_index(CamelFolderSummary *, ibex *); void camel_folder_summary_set_build_content(CamelFolderSummary *, gboolean state); -guint32 camel_folder_summary_next_uid(CamelFolderSummary *s); +guint32 camel_folder_summary_next_uid (CamelFolderSummary *s); +char *camel_folder_summary_next_uid_string (CamelFolderSummary *s); /* load/save the summary in its entirety */ int camel_folder_summary_load(CamelFolderSummary *); |