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



Author: sragavan
Date: Wed Aug 20 17:05:00 2008
New Revision: 9410
URL: http://svn.gnome.org/viewvc/evolution-data-server?rev=9410&view=rev

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

	* camel/providers/local/camel-maildir-summary.c: Make it use sort by
	dreceived from db.


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

Modified: trunk/camel/providers/local/camel-maildir-summary.c
==============================================================================
--- trunk/camel/providers/local/camel-maildir-summary.c	(original)
+++ trunk/camel/providers/local/camel-maildir-summary.c	Wed Aug 20 17:05:00 2008
@@ -168,7 +168,8 @@
 	CamelMaildirSummary *o = (CamelMaildirSummary *)camel_object_new(camel_maildir_summary_get_type ());
 
 	((CamelFolderSummary *)o)->folder = folder;
-
+	if (folder)
+		camel_db_set_collate (folder->cdb, "dreceived", NULL, NULL);
 	camel_local_summary_construct((CamelLocalSummary *)o, filename, maildirdir, index);
 	return o;
 }
@@ -520,21 +521,6 @@
 }
 
 static int
-sort_receive_cmp(const void *ap, const void *bp)
-{
-	const CamelMaildirMessageInfo
-		*a = *((CamelMaildirMessageInfo **)ap),
-		*b = *((CamelMaildirMessageInfo **)bp);
-
-	if (a->info.info.date_received < b->info.info.date_received)
-		return -1;
-	else if (a->info.info.date_received > b->info.info.date_received)
-		return 1;
-
-	return 0;
-}
-
-static int
 maildir_summary_check(CamelLocalSummary *cls, CamelFolderChangeInfo *changes, CamelException *ex)
 {
 	DIR *dir;
@@ -724,12 +710,6 @@
 	g_free(new);
 	g_free(cur);
 
-	/* sort the summary based on receive time, since the directory order is not useful */
-	CAMEL_SUMMARY_LOCK(s, summary_lock);
-	#warning Add support for sorting via the DB.
-/* 	qsort(s->messages->pdata, s->messages->len, sizeof(CamelMessageInfo *), sort_receive_cmp); */
-	CAMEL_SUMMARY_UNLOCK(s, summary_lock);
-
 	g_mutex_unlock (((CamelMaildirSummary *) cls)->priv->summary_lock);
 
 	return 0;



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