evolution-data-server r9403 - trunk/camel/providers/local



Author: sragavan
Date: Wed Aug 20 10:55:49 2008
New Revision: 9403
URL: http://svn.gnome.org/viewvc/evolution-data-server?rev=9403&view=rev

Log:
2008-08-20  Srinivasa Ragavan  <sragavan novell com>

	** Fix for bug #213072

	* camel/providers/local/camel-mbox-summary.c: Sort mbox/spool summary
	uids by from_pos.


Modified:
   trunk/camel/providers/local/ChangeLog
   trunk/camel/providers/local/camel-mbox-summary.c

Modified: trunk/camel/providers/local/camel-mbox-summary.c
==============================================================================
--- trunk/camel/providers/local/camel-mbox-summary.c	(original)
+++ trunk/camel/providers/local/camel-mbox-summary.c	Wed Aug 20 10:55:49 2008
@@ -210,6 +210,18 @@
 {
 	/*CamelMboxSummary *mbs = CAMEL_MBOX_SUMMARY(obj);*/
 }
+static int 
+frompos_sort (void *enc, int len1, void * data1, int len2, void *data2)
+{
+	char *sa1 = (char*)g_utf8_normalize (data1, len1, G_NORMALIZE_DEFAULT);
+	char *sa2 = (char*)g_utf8_normalize (data2, len2, G_NORMALIZE_DEFAULT);
+	int a1 = strtoul (sa1, NULL, 10);
+	int a2 = strtoul (sa2, NULL, 10);
+
+	g_free(sa1); g_free(sa2);
+
+	return a1 > a2;
+}
 
 /**
  * camel_mbox_summary_new:
@@ -224,7 +236,11 @@
 	CamelMboxSummary *new = (CamelMboxSummary *)camel_object_new(camel_mbox_summary_get_type());
 
 	((CamelFolderSummary *)new)->folder = folder;
-
+	if (folder) {
+		/* Set the functions for db sorting */
+		/* FIXME: Add column names though a #define */
+		camel_db_set_collate (folder->cdb, "bdata", "frompos_sort", (CamelDBCollate)frompos_sort);
+	}
 	camel_local_summary_construct((CamelLocalSummary *)new, filename, mbox_name, index);
 	return new;
 }



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