evolution-data-server r8967 - branches/camel-db-summary/camel/providers/imap
- From: psankar svn gnome org
- To: svn-commits-list gnome org
- Subject: evolution-data-server r8967 - branches/camel-db-summary/camel/providers/imap
- Date: Wed, 11 Jun 2008 08:27:31 +0000 (UTC)
Author: psankar
Date: Wed Jun 11 08:27:31 2008
New Revision: 8967
URL: http://svn.gnome.org/viewvc/evolution-data-server?rev=8967&view=rev
Log:
Sort IMAP uids once we load them onto memory.
Modified:
branches/camel-db-summary/camel/providers/imap/camel-imap-summary.c
Modified: branches/camel-db-summary/camel/providers/imap/camel-imap-summary.c
==============================================================================
--- branches/camel-db-summary/camel/providers/imap/camel-imap-summary.c (original)
+++ branches/camel-db-summary/camel/providers/imap/camel-imap-summary.c Wed Jun 11 08:27:31 2008
@@ -63,6 +63,8 @@
static void camel_imap_summary_class_init (CamelImapSummaryClass *klass);
static void camel_imap_summary_init (CamelImapSummary *obj);
+static int uid_compare (const void *va, const void *vb);
+
static CamelFolderSummaryClass *camel_imap_summary_parent;
CamelType
@@ -163,6 +165,7 @@
camel_folder_summary_clear_db (summary);
}
+ g_ptr_array_sort (summary->uids, (GCompareFunc) uid_compare);
return summary;
}
@@ -340,7 +343,7 @@
if (part) {
EXTRACT_FIRST_DIGIT (type);
}
-
+ mir->cinfo = part;
if (type)
return camel_imap_summary_parent->content_info_from_db (s, mir);
else
@@ -422,3 +425,21 @@
camel_folder_summary_add (summary, (CamelMessageInfo *)mi);
}
+
+
+static int
+uid_compare (const void *va, const void *vb)
+{
+ const char **sa = (const char **)va, **sb = (const char **)vb;
+ unsigned long a, b;
+
+ a = strtoul (*sa, NULL, 10);
+ b = strtoul (*sb, NULL, 10);
+ if (a < b)
+ return -1;
+ else if (a == b)
+ return 0;
+ else
+ return 1;
+}
+
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]