evolution-data-server r9291 - trunk/camel
- From: sragavan svn gnome org
- To: svn-commits-list gnome org
- Subject: evolution-data-server r9291 - trunk/camel
- Date: Thu, 7 Aug 2008 04:44:19 +0000 (UTC)
Author: sragavan
Date: Thu Aug 7 04:44:19 2008
New Revision: 9291
URL: http://svn.gnome.org/viewvc/evolution-data-server?rev=9291&view=rev
Log:
2008-08-07 Srinivasa Ragavan <sragavan novell com>
* camel/camel-folder-summary.c: Store to db intelligently.
Modified:
trunk/camel/ChangeLog
trunk/camel/camel-folder-summary.c
Modified: trunk/camel/camel-folder-summary.c
==============================================================================
--- trunk/camel/camel-folder-summary.c (original)
+++ trunk/camel/camel-folder-summary.c Thu Aug 7 04:44:19 2008
@@ -1286,18 +1286,27 @@
d(printf ("\ncamel_folder_summary_save_to_db called \n"));
+ if (!(s->flags & CAMEL_SUMMARY_DIRTY))
+ return 0;
+
+ s->flags &= ~CAMEL_SUMMARY_DIRTY;
+
+
camel_db_begin_transaction (cdb, ex);
ret = save_message_infos_to_db (s, ex);
if (ret != 0) {
camel_db_abort_transaction (cdb, ex);
+ /* Failed, so lets reset the flag */
+ s->flags |= CAMEL_SUMMARY_DIRTY;
return -1;
}
camel_db_end_transaction (cdb, ex);
record = (((CamelFolderSummaryClass *)(CAMEL_OBJECT_GET_CLASS(s)))->summary_header_to_db (s, ex));
if (!record) {
+ s->flags |= CAMEL_SUMMARY_DIRTY;
return -1;
}
@@ -1308,6 +1317,7 @@
if (ret != 0) {
camel_db_abort_transaction (cdb, ex);
+ s->flags |= CAMEL_SUMMARY_DIRTY;
return -1;
}
@@ -1992,7 +2002,6 @@
g_hash_table_destroy(s->loaded_infos);
s->loaded_infos = g_hash_table_new(g_str_hash, g_str_equal);
- s->flags |= CAMEL_SUMMARY_DIRTY;
CAMEL_SUMMARY_UNLOCK(s, summary_lock);
camel_db_clear_folder_summary (cdb, folder_name, NULL);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]