evolution-data-server r9264 - trunk/camel
- From: sragavan svn gnome org
- To: svn-commits-list gnome org
- Subject: evolution-data-server r9264 - trunk/camel
- Date: Tue, 5 Aug 2008 07:16:18 +0000 (UTC)
Author: sragavan
Date: Tue Aug 5 07:16:17 2008
New Revision: 9264
URL: http://svn.gnome.org/viewvc/evolution-data-server?rev=9264&view=rev
Log:
2008-08-05 Srinivasa Ragavan <sragavan novell com>
* camel/camel-vee-folder.c:
* camel/camel-vee-summary.c: Safe guard against missing infos and
protect them and added debug logs for erring cases.
Modified:
trunk/camel/ChangeLog
trunk/camel/camel-vee-folder.c
trunk/camel/camel-vee-summary.c
Modified: trunk/camel/camel-vee-folder.c
==============================================================================
--- trunk/camel/camel-vee-folder.c (original)
+++ trunk/camel/camel-vee-folder.c Tue Aug 5 07:16:17 2008
@@ -479,7 +479,7 @@
record->folder_name = table_name;
/* we always write out the current version */
- record->version = 13; //FIXME CAMEL_FOLDER_SUMMARY_VERSION;
+ record->version = 13; /* FIXME: CAMEL_FOLDER_SUMMARY_VERSION; */
record->flags = s->flags;
record->nextuid = s->nextuid;
record->time = s->time;
@@ -514,7 +514,7 @@
camel_exception_setv(ex, ex->id, _("Error storing '%s': %s"), desc, ex->desc);
break;
}
-#warning "see if it is really required"
+
/* auto update vfolders shouldn't need a rebuild */
/* if ((vf->flags & CAMEL_STORE_VEE_FOLDER_AUTO) == 0 */
/* && camel_vee_folder_rebuild_folder(vf, f, ex) == -1) */
@@ -524,7 +524,6 @@
}
record = summary_header_to_db (folder->summary, ex);
- #warning handle exception and ret
camel_db_write_folder_info_record (folder->parent_store->cdb, record, ex);
g_free (record);
Modified: trunk/camel/camel-vee-summary.c
==============================================================================
--- trunk/camel/camel-vee-summary.c (original)
+++ trunk/camel/camel-vee-summary.c Tue Aug 5 07:16:17 2008
@@ -57,7 +57,6 @@
to = (CamelVeeMessageInfo *)camel_message_info_new(s);
to->summary = from->summary;
- /* FIXME: We may not need this during CamelDBSummary */
camel_object_ref (to->summary);
to->info.summary = s;
to->info.uid = camel_pstring_strdup(from->info.uid);
@@ -65,16 +64,19 @@
return (CamelMessageInfo *)to;
}
+#define HANDLE_NULL_INFO(value) if (!rmi) { g_warning (G_STRLOC ": real info is NULL for %s, safeguarding\n", mi->uid); return value; }
+
static const void *
vee_info_ptr (const CamelMessageInfo *mi, int id)
{
CamelVeeMessageInfo *vmi = (CamelVeeMessageInfo *) mi;
- CamelMessageInfo *info;
+ CamelMessageInfo *rmi;
gpointer p;
- info = camel_folder_summary_uid (vmi->summary, mi->uid+8);
- p = (gpointer) camel_message_info_ptr(info, id);
- camel_message_info_free (info);
+ rmi = camel_folder_summary_uid (vmi->summary, mi->uid+8);
+ HANDLE_NULL_INFO(NULL);
+ p = (gpointer) camel_message_info_ptr(rmi, id);
+ camel_message_info_free (rmi);
return p;
}
@@ -83,8 +85,10 @@
vee_info_uint32(const CamelMessageInfo *mi, int id)
{
CamelMessageInfo *rmi = camel_folder_summary_uid (((CamelVeeMessageInfo *)mi)->summary, mi->uid+8);
- guint32 ret = camel_message_info_uint32 (rmi, id);
-
+ guint32 ret;
+
+ HANDLE_NULL_INFO(0);
+ ret = camel_message_info_uint32 (rmi, id);
camel_message_info_free (rmi);
return ret;
@@ -95,7 +99,10 @@
vee_info_time(const CamelMessageInfo *mi, int id)
{
CamelMessageInfo *rmi = camel_folder_summary_uid (((CamelVeeMessageInfo *)mi)->summary, mi->uid+8);
- time_t ret = camel_message_info_time (rmi, id);
+ time_t ret;
+
+ HANDLE_NULL_INFO(0);
+ ret = camel_message_info_time (rmi, id);
camel_message_info_free (rmi);
return ret;
@@ -105,7 +112,10 @@
vee_info_user_flag(const CamelMessageInfo *mi, const char *id)
{
CamelMessageInfo *rmi = camel_folder_summary_uid (((CamelVeeMessageInfo *)mi)->summary, mi->uid+8);
- gboolean ret = camel_message_info_user_flag (rmi, id);
+ gboolean ret;
+
+ HANDLE_NULL_INFO(FALSE);
+ ret = camel_message_info_user_flag (rmi, id);
camel_message_info_free (rmi);
return ret;
@@ -115,7 +125,10 @@
vee_info_user_tag(const CamelMessageInfo *mi, const char *id)
{
CamelMessageInfo *rmi = camel_folder_summary_uid (((CamelVeeMessageInfo *)mi)->summary, mi->uid+8);
- const char *ret = camel_message_info_user_tag (rmi, id);
+ const char *ret;
+
+ HANDLE_NULL_INFO("");
+ ret = camel_message_info_user_tag (rmi, id);
camel_message_info_free (rmi);
return ret;
@@ -128,6 +141,7 @@
if (mi->uid) {
CamelMessageInfo *rmi = camel_folder_summary_uid (((CamelVeeMessageInfo *)mi)->summary, mi->uid+8);
+ HANDLE_NULL_INFO(FALSE);
res = camel_message_info_set_user_flag(rmi, name, value);
camel_message_info_free (rmi);
}
@@ -142,6 +156,7 @@
if (mi->uid) {
CamelMessageInfo *rmi = camel_folder_summary_uid (((CamelVeeMessageInfo *)mi)->summary, mi->uid+8);
+ HANDLE_NULL_INFO(FALSE);
res = camel_message_info_set_user_tag(rmi, name, value);
camel_message_info_free (rmi);
}
@@ -155,7 +170,8 @@
int res = FALSE;
if (mi->uid) {
- CamelMessageInfo *rmi = camel_folder_summary_uid (((CamelVeeMessageInfo *)mi)->summary, mi->uid+8);
+ CamelMessageInfo *rmi = camel_folder_summary_uid (((CamelVeeMessageInfo *)mi)->summary, mi->uid+8);
+ HANDLE_NULL_INFO(FALSE);
res = camel_message_info_set_flags(rmi, flags, set);
camel_message_info_free (rmi);
}
@@ -288,8 +304,8 @@
vuid = g_malloc(strlen(uid)+9);
memcpy(vuid, hash, 8);
strcpy(vuid+8, uid);
-
- #warning do we need it really ?
+
+ /* We really dont need it. */
/* mi = (CamelVeeMessageInfo *)camel_folder_summary_uid(&s->summary, vuid); */
/* if (mi) { */
/* d(printf("w:clash, we already have '%s' in summary\n", vuid)); */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]