evolution-data-server r9674 - in trunk/camel: . providers/imap



Author: sragavan
Date: Wed Oct 15 07:39:14 2008
New Revision: 9674
URL: http://svn.gnome.org/viewvc/evolution-data-server?rev=9674&view=rev

Log:
2008-10-15  Srinivasa Ragavan  <sragavan novell com>

	* camel-folder-summary.c: (perform_content_info_load_from_db),
	(perform_content_info_save_to_db): Save/load Content info well in DB.
	Imap cached messages aren't coming up due to this.




Modified:
   trunk/camel/ChangeLog
   trunk/camel/camel-folder-summary.c
   trunk/camel/providers/imap/ChangeLog
   trunk/camel/providers/imap/camel-imap-folder.c
   trunk/camel/providers/imap/camel-imap-summary.c

Modified: trunk/camel/camel-folder-summary.c
==============================================================================
--- trunk/camel/camel-folder-summary.c	(original)
+++ trunk/camel/camel-folder-summary.c	Wed Oct 15 07:39:14 2008
@@ -96,7 +96,7 @@
 #define EXTRACT_FIRST_STRING(val) len=strtoul (part, &part, 10); if (*part) part++; val=g_strndup (part, len); part+=len;
 #define EXTRACT_STRING(val) if (*part) part++; len=strtoul (part, &part, 10); if (*part) part++; val=g_strndup (part, len); part+=len;
 #define EXTRACT_FIRST_DIGIT(val) val=strtoul (part, &part, 10);
-#define EXTRACT_DIGIT(val) if (*part) part++; val=strtoul (part, &part, 10);
+#define EXTRACT_DIGIT(val) if (*part && *part == ' ') part++; val=strtoul (part, &part, 10);
 
 /* trivial lists, just because ... */
 struct _node {
@@ -661,6 +661,7 @@
 	guint32 count;
 	CamelMessageContentInfo *ci, *pci;
 	char *part;
+
 	ci = ((CamelFolderSummaryClass *)(CAMEL_OBJECT_GET_CLASS(s)))->content_info_from_db (s, mir);
 	if (ci == NULL)
 		return NULL;
@@ -1234,9 +1235,10 @@
 {
 	CamelMessageContentInfo *part;
 	char *oldr;
+
 	if (((CamelFolderSummaryClass *)(CAMEL_OBJECT_GET_CLASS (s)))->content_info_to_db (s, ci, record) == -1)
 		return -1;
-	
+
 	oldr = record->cinfo;
 	record->cinfo = g_strdup_printf ("%s %d", oldr, my_list_size ((struct _node **)&ci->childs));
 	g_free (oldr);

Modified: trunk/camel/providers/imap/camel-imap-folder.c
==============================================================================
--- trunk/camel/providers/imap/camel-imap-folder.c	(original)
+++ trunk/camel/providers/imap/camel-imap-folder.c	Wed Oct 15 07:39:14 2008
@@ -2874,6 +2874,7 @@
 					if (body) {
 						/* NB: small race here, setting the info.content */
 						imap_parse_body ((const char **) &body, folder, mi->info.content);
+						mi->info.dirty = TRUE;
 						camel_folder_summary_touch (folder->summary);
 					}
 

Modified: trunk/camel/providers/imap/camel-imap-summary.c
==============================================================================
--- trunk/camel/providers/imap/camel-imap-summary.c	(original)
+++ trunk/camel/providers/imap/camel-imap-summary.c	Wed Oct 15 07:39:14 2008
@@ -376,7 +376,11 @@
 	guint32 type=0;
 	
 	if (part) {
-		EXTRACT_FIRST_DIGIT (type);
+		if (*part == ' ')
+			part++;
+		if (part){
+			EXTRACT_FIRST_DIGIT (type);
+		}
 	}
 	mir->cinfo = part;
 	if (type)
@@ -397,11 +401,16 @@
 static int
 content_info_to_db (CamelFolderSummary *s, CamelMessageContentInfo *info, CamelMIRecord *mir)
 {
+	char *oldr;
 	if (info->type) {
-		mir->cinfo = g_strdup ("1");
+		oldr = mir->cinfo;
+		mir->cinfo = oldr ? g_strdup_printf("%s 1", oldr) : g_strdup ("1");
+		g_free(oldr);
 		return camel_imap_summary_parent->content_info_to_db (s, info, mir);
 	} else {
-		mir->cinfo = g_strdup ("0");
+		oldr = mir->cinfo;
+		mir->cinfo = oldr ? g_strdup_printf("%s 0", oldr) : g_strdup ("0");
+		g_free(oldr);
 		return 0;
 	}
 }



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]