From d04571a410a01bd2ae077eb0df17594cc183e440 Mon Sep 17 00:00:00 2001 From: Srinivasa Ragavan Date: Tue, 29 Jul 2008 04:29:54 +0000 Subject: [PATCH] Fix uid/pstring issues. 2008-07-28 Srinivasa Ragavan * camel/camel-digest-folder.c: Fix uid/pstring issues. * camel/camel-folder-summary.c: * camel/camel-folder-summary.h: Make uid const char * * camel/camel-vee-summary.c: svn path=/trunk/; revision=9217 --- camel/ChangeLog | 7 +++++++ camel/camel-digest-folder.c | 8 ++++++-- camel/camel-folder-summary.c | 2 +- camel/camel-folder-summary.h | 4 ++-- camel/camel-vee-summary.c | 5 +++-- camel/providers/groupwise/ChangeLog | 5 +++++ camel/providers/groupwise/camel-groupwise-journal.c | 2 +- camel/providers/imap/ChangeLog | 4 ++++ camel/providers/imap/camel-imap-folder.c | 2 +- camel/providers/nntp/ChangeLog | 4 ++++ camel/providers/nntp/camel-nntp-summary.c | 6 ++++-- 11 files changed, 38 insertions(+), 11 deletions(-) diff --git a/camel/ChangeLog b/camel/ChangeLog index 28e4676..e418643 100644 --- a/camel/ChangeLog +++ b/camel/ChangeLog @@ -1,4 +1,11 @@ 2008-07-28 Srinivasa Ragavan + + * camel/camel-digest-folder.c: Fix uid/pstring issues. + * camel/camel-folder-summary.c: + * camel/camel-folder-summary.h: Make uid const char * + * camel/camel-vee-summary.c: + +2008-07-28 Srinivasa Ragavan * camel/camel-disco-folder.c: Fix guint/int issues. * camel/camel-folder-summary.c: diff --git a/camel/camel-digest-folder.c b/camel/camel-digest-folder.c index 0c7cbd7..1bae8ec 100644 --- a/camel/camel-digest-folder.c +++ b/camel/camel-digest-folder.c @@ -30,6 +30,7 @@ #include "camel-folder-search.h" #include "camel-mime-message.h" #include "camel-multipart.h" +#include "camel-string-utils.h" #define d(x) @@ -181,6 +182,7 @@ digest_add_multipart (CamelFolder *folder, CamelMultipart *multipart, const char parts = camel_multipart_get_number (multipart); for (i = 0; i < parts; i++) { + char *tmp; part = camel_multipart_get_part (multipart, i); wrapper = camel_medium_get_content_object (CAMEL_MEDIUM (part)); @@ -195,8 +197,10 @@ digest_add_multipart (CamelFolder *folder, CamelMultipart *multipart, const char } info = camel_folder_summary_info_new_from_message (folder->summary, CAMEL_MIME_MESSAGE (wrapper)); - g_free(info->uid); - info->uid = g_strdup_printf ("%s%d", preuid, i); + camel_pstring_free(info->uid); + tmp = g_strdup_printf ("%s%d", preuid, i); + info->uid = camel_pstring_strdup (tmp); + g_free(tmp); camel_folder_summary_add (folder->summary, info); } } diff --git a/camel/camel-folder-summary.c b/camel/camel-folder-summary.c index b10208e..fdac04a 100644 --- a/camel/camel-folder-summary.c +++ b/camel/camel-folder-summary.c @@ -1091,7 +1091,7 @@ camel_folder_summary_migrate_infos(CamelFolderSummary *s) } mi->dirty = TRUE; - g_hash_table_insert (s->loaded_infos, mi->uid, mi); + g_hash_table_insert (s->loaded_infos, (gpointer) mi->uid, mi); } diff --git a/camel/camel-folder-summary.h b/camel/camel-folder-summary.h index 31f2605..c5e2202 100644 --- a/camel/camel-folder-summary.h +++ b/camel/camel-folder-summary.h @@ -152,7 +152,7 @@ struct _CamelMessageInfo { CamelFolderSummary *summary; guint32 refcount; /* ??? */ - char *uid; + const char *uid; /*FIXME: Make it work with the CAMEL_MESSADE_DB_DIRTY flag instead of another 4 bytes*/ int dirty:1; }; @@ -164,7 +164,7 @@ struct _CamelMessageInfoBase { CamelFolderSummary *summary; guint32 refcount; /* ??? */ - char *uid; + const char *uid; /*FIXME: Make it work with the CAMEL_MESSADE_DB_DIRTY flag instead of another 4 bytes*/ int dirty:1; diff --git a/camel/camel-vee-summary.c b/camel/camel-vee-summary.c index e39097c..81bcc15 100644 --- a/camel/camel-vee-summary.c +++ b/camel/camel-vee-summary.c @@ -44,7 +44,7 @@ vee_message_info_free(CamelFolderSummary *s, CamelMessageInfo *info) { CamelVeeMessageInfo *mi = (CamelVeeMessageInfo *)info; - g_free(info->uid); + camel_pstring_free(info->uid); camel_object_unref (mi->summary); } @@ -60,7 +60,8 @@ vee_message_info_clone(CamelFolderSummary *s, const CamelMessageInfo *mi) /* FIXME: We may not need this during CamelDBSummary */ camel_object_ref (to->summary); to->info.summary = s; - + to->info.uid = camel_pstring_strdup(from->info.uid); + return (CamelMessageInfo *)to; } diff --git a/camel/providers/groupwise/ChangeLog b/camel/providers/groupwise/ChangeLog index 1f90b19..44684be 100644 --- a/camel/providers/groupwise/ChangeLog +++ b/camel/providers/groupwise/ChangeLog @@ -1,3 +1,8 @@ +2008-07-28 Srinivasa Ragavan + + * camel/providers/groupwise/camel-groupwise-journal.c: Fix uid/pstring + issues. + 2008-07-22 Sankar P * camel-groupwise-folder.c (gw_update_summary): diff --git a/camel/providers/groupwise/camel-groupwise-journal.c b/camel/providers/groupwise/camel-groupwise-journal.c index bd9e602..30c73e6 100644 --- a/camel/providers/groupwise/camel-groupwise-journal.c +++ b/camel/providers/groupwise/camel-groupwise-journal.c @@ -374,7 +374,7 @@ update_cache (CamelGroupwiseJournal *groupwise_journal, CamelMimeMessage *messag camel_object_unref (cache); info = camel_folder_summary_info_new_from_message (folder->summary, message); - g_free(info->uid); + camel_pstring_free(info->uid); info->uid = camel_pstring_strdup (uid); gw_message_info_dup_to ((CamelMessageInfoBase *) info, (CamelMessageInfoBase *) mi); diff --git a/camel/providers/imap/ChangeLog b/camel/providers/imap/ChangeLog index fcb6997..e5dfc16 100644 --- a/camel/providers/imap/ChangeLog +++ b/camel/providers/imap/ChangeLog @@ -1,5 +1,9 @@ 2008-07-28 Srinivasa Ragavan + * camel/providers/imap/camel-imap-folder.c: Fix uid/pstring issues. + +2008-07-28 Srinivasa Ragavan + * camel/providers/imap/camel-imap-folder.c: Fix compiler warnings. * camel/providers/imap/camel-imap-message-cache.c: * camel/providers/imap/camel-imap-utils.c: diff --git a/camel/providers/imap/camel-imap-folder.c b/camel/providers/imap/camel-imap-folder.c index 4d2b5e1..818a8c7 100644 --- a/camel/providers/imap/camel-imap-folder.c +++ b/camel/providers/imap/camel-imap-folder.c @@ -706,7 +706,7 @@ imap_refresh_info (CamelFolder *folder, CamelException *ex) if (check_rescan && !camel_application_is_exiting && !camel_exception_is_set (ex)) { if (check_rescan == -1) { - guint32 total, unread, server_total, server_unread; + guint32 total, unread, server_total=0, server_unread=0; check_rescan = 0; diff --git a/camel/providers/nntp/ChangeLog b/camel/providers/nntp/ChangeLog index f5df2fd..26db979 100644 --- a/camel/providers/nntp/ChangeLog +++ b/camel/providers/nntp/ChangeLog @@ -1,3 +1,7 @@ +2008-07-28 Srinivasa Ragavan + + * camel/providers/nntp/camel-nntp-summary.c: Fix uid/pstring issues. + 2008-07-16 Sankar P Pushing disk summary changes from the madagascar branch diff --git a/camel/providers/nntp/camel-nntp-summary.c b/camel/providers/nntp/camel-nntp-summary.c index cca3f15..1688443 100644 --- a/camel/providers/nntp/camel-nntp-summary.c +++ b/camel/providers/nntp/camel-nntp-summary.c @@ -43,6 +43,7 @@ #include "camel-nntp-store.h" #include "camel-nntp-stream.h" #include "camel-nntp-summary.h" +#include "camel-string-utils.h" #define w(x) #define io(x) @@ -158,8 +159,9 @@ message_info_new_from_header(CamelFolderSummary *s, struct _camel_header_raw *h) mi = (CamelMessageInfoBase *)((CamelFolderSummaryClass *)camel_nntp_summary_parent)->message_info_new_from_header(s, h); if (mi) { - g_free(mi->uid); - mi->uid = cns->priv->uid; + camel_pstring_free(mi->uid); + mi->uid = camel_pstring_strdup(cns->priv->uid); + g_free(cns->priv->uid); cns->priv->uid = NULL; } -- 2.7.4