Fix uid/pstring issues.
authorSrinivasa Ragavan <sragavan@novell.com>
Tue, 29 Jul 2008 04:29:54 +0000 (04:29 +0000)
committerSrinivasa Ragavan <sragavan@src.gnome.org>
Tue, 29 Jul 2008 04:29:54 +0000 (04:29 +0000)
2008-07-28  Srinivasa Ragavan  <sragavan@novell.com>

* 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
camel/camel-digest-folder.c
camel/camel-folder-summary.c
camel/camel-folder-summary.h
camel/camel-vee-summary.c
camel/providers/groupwise/ChangeLog
camel/providers/groupwise/camel-groupwise-journal.c
camel/providers/imap/ChangeLog
camel/providers/imap/camel-imap-folder.c
camel/providers/nntp/ChangeLog
camel/providers/nntp/camel-nntp-summary.c

index 28e4676..e418643 100644 (file)
@@ -1,4 +1,11 @@
 2008-07-28  Srinivasa Ragavan  <sragavan@novell.com>
+
+       * 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  <sragavan@novell.com>
        
        * camel/camel-disco-folder.c: Fix guint/int issues.
        * camel/camel-folder-summary.c:
index 0c7cbd7..1bae8ec 100644 (file)
@@ -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);
        }
 }
index b10208e..fdac04a 100644 (file)
@@ -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);
        }
 
        
index 31f2605..c5e2202 100644 (file)
@@ -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;
        
index e39097c..81bcc15 100644 (file)
@@ -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;
 }
 
index 1f90b19..44684be 100644 (file)
@@ -1,3 +1,8 @@
+2008-07-28  Srinivasa Ragavan  <sragavan@novell.com>
+
+       * camel/providers/groupwise/camel-groupwise-journal.c: Fix uid/pstring
+       issues.
+
 2008-07-22  Sankar P  <psankar@novell.com>
 
        * camel-groupwise-folder.c (gw_update_summary):
index bd9e602..30c73e6 100644 (file)
@@ -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);
index fcb6997..e5dfc16 100644 (file)
@@ -1,5 +1,9 @@
 2008-07-28  Srinivasa Ragavan  <sragavan@novell.com>
 
+       * camel/providers/imap/camel-imap-folder.c: Fix uid/pstring issues.
+
+2008-07-28  Srinivasa Ragavan  <sragavan@novell.com>
+
        * 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:
index 4d2b5e1..818a8c7 100644 (file)
@@ -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;
                        
index f5df2fd..26db979 100644 (file)
@@ -1,3 +1,7 @@
+2008-07-28  Srinivasa Ragavan  <sragavan@novell.com>
+
+       * camel/providers/nntp/camel-nntp-summary.c: Fix uid/pstring issues.
+
 2008-07-16  Sankar P  <psankar@novell.com>
 
        Pushing disk summary changes from the madagascar branch
index cca3f15..1688443 100644 (file)
@@ -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;
        }