evolution-data-server r9737 - in branches/gnome-2-24/camel: . providers/imap



Author: sragavan
Date: Fri Nov  7 03:23:08 2008
New Revision: 9737
URL: http://svn.gnome.org/viewvc/evolution-data-server?rev=9737&view=rev

Log:
2008-11-07  Srinivasa Ragavan  <sragavan novell com>

	** Fix for bug #558883

	* camel-db.c: (camel_db_prepare_message_info_table): Index more
	fields.




Modified:
   branches/gnome-2-24/camel/ChangeLog
   branches/gnome-2-24/camel/camel-db.c
   branches/gnome-2-24/camel/providers/imap/ChangeLog
   branches/gnome-2-24/camel/providers/imap/camel-imap-folder.c

Modified: branches/gnome-2-24/camel/camel-db.c
==============================================================================
--- branches/gnome-2-24/camel/camel-db.c	(original)
+++ branches/gnome-2-24/camel/camel-db.c	Fri Nov  7 03:23:08 2008
@@ -737,6 +737,27 @@
 	ret = camel_db_add_to_transaction (cdb, table_creation_query, ex);
 	g_free (safe_index);
 	sqlite3_free (table_creation_query);
+
+	/* Index on deleted*/
+	safe_index = g_strdup_printf("DELINDEX-%s", folder_name);
+	table_creation_query = sqlite3_mprintf ("CREATE INDEX IF NOT EXISTS %Q ON %Q (deleted)", safe_index, folder_name);
+	ret = camel_db_add_to_transaction (cdb, table_creation_query, ex);
+	g_free (safe_index);
+	sqlite3_free (table_creation_query);
+
+	/* Index on Junk*/
+	safe_index = g_strdup_printf("JUNKINDEX-%s", folder_name);
+	table_creation_query = sqlite3_mprintf ("CREATE INDEX IF NOT EXISTS %Q ON %Q (junk)", safe_index, folder_name);
+	ret = camel_db_add_to_transaction (cdb, table_creation_query, ex);
+	g_free (safe_index);
+	sqlite3_free (table_creation_query);
+	
+	/* Index on unread*/
+	safe_index = g_strdup_printf("READINDEX-%s", folder_name);
+	table_creation_query = sqlite3_mprintf ("CREATE INDEX IF NOT EXISTS %Q ON %Q (read)", safe_index, folder_name);
+	ret = camel_db_add_to_transaction (cdb, table_creation_query, ex);
+	g_free (safe_index);
+	sqlite3_free (table_creation_query);
 	
 	return ret;
 }

Modified: branches/gnome-2-24/camel/providers/imap/camel-imap-folder.c
==============================================================================
--- branches/gnome-2-24/camel/providers/imap/camel-imap-folder.c	(original)
+++ branches/gnome-2-24/camel/providers/imap/camel-imap-folder.c	Fri Nov  7 03:23:08 2008
@@ -1584,25 +1584,16 @@
 {
 	CamelImapStore *store = CAMEL_IMAP_STORE (folder->parent_store);
 	GPtrArray *uids;
-	int i, count;
-	CamelMessageInfo *info;
 
-	uids = g_ptr_array_new ();
-	count = camel_folder_summary_count (folder->summary);
-	for (i = 0; i < count; i++) {
-		info = camel_folder_summary_index (folder->summary, i);
-		if (camel_message_info_flags(info) & CAMEL_MESSAGE_DELETED)
-			g_ptr_array_add (uids, g_strdup (camel_message_info_uid (info)));
-		camel_message_info_free(info);
-	}
+	camel_folder_summary_save_to_db (folder->summary, ex);
+	uids = camel_db_get_folder_deleted_uids (folder->parent_store->cdb_r, folder->full_name, ex);
 
 	if (CAMEL_OFFLINE_STORE (store)->state == CAMEL_OFFLINE_STORE_NETWORK_AVAIL)
 		imap_expunge_uids_online (folder, uids, ex);
 	else
 		imap_expunge_uids_offline (folder, uids, ex);
 
-	for (i = 0; i < uids->len; i++)
-		g_free (uids->pdata[i]);
+	g_ptr_array_foreach (uids, (GFunc) camel_pstring_free, NULL);
 	g_ptr_array_free (uids, TRUE);
 }
 



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