evolution-data-server r8954 - branches/camel-db-summary/camel
- From: sragavan svn gnome org
- To: svn-commits-list gnome org
- Subject: evolution-data-server r8954 - branches/camel-db-summary/camel
- Date: Mon, 9 Jun 2008 06:43:28 +0000 (UTC)
Author: sragavan
Date: Mon Jun 9 06:43:28 2008
New Revision: 8954
URL: http://svn.gnome.org/viewvc/evolution-data-server?rev=8954&view=rev
Log:
Revert previous commits.
Modified:
branches/camel-db-summary/camel/camel-folder-summary.c
branches/camel-db-summary/camel/camel-folder-thread.c
branches/camel-db-summary/camel/camel-folder.c
branches/camel-db-summary/camel/camel-vee-summary.c
branches/camel-db-summary/camel/camel-vtrash-folder.c
branches/camel-db-summary/camel/camel-vtrash-folder.h
Modified: branches/camel-db-summary/camel/camel-folder-summary.c
==============================================================================
--- branches/camel-db-summary/camel/camel-folder-summary.c (original)
+++ branches/camel-db-summary/camel/camel-folder-summary.c Mon Jun 9 06:43:28 2008
@@ -438,11 +438,8 @@
CAMEL_SUMMARY_LOCK(s, summary_lock);
g_ptr_array_set_size(res, s->uids->len);
- for (i=0;i<s->uids->len;i++) {
- char *uid;
- uid = g_ptr_array_index(s->uids, i);
- res->pdata[i] = uid;
- }
+ for (i=0;i<s->uids->len;i++)
+ res->pdata[i] = g_ptr_array_index(s->uids, i);
CAMEL_SUMMARY_UNLOCK(s, summary_lock);
@@ -474,8 +471,6 @@
info = g_hash_table_lookup (s->loaded_infos, uid);
- CAMEL_SUMMARY_UNLOCK(s, ref_lock);
- CAMEL_SUMMARY_UNLOCK(s, summary_lock);
if (!info) {
CamelDB *cdb;
CamelException ex;// May be this should come from the caller
@@ -487,27 +482,29 @@
folder_name = s->folder->full_name;
cdb = s->folder->parent_store->cdb;
-
+
+ CAMEL_SUMMARY_UNLOCK(s, ref_lock);
+ CAMEL_SUMMARY_UNLOCK(s, summary_lock);
ret = camel_db_read_message_info_record_with_uid (cdb, folder_name, uid, (gpointer**) &s, camel_read_mir_callback, &ex);
if (ret != 0) {
return NULL;
}
CAMEL_SUMMARY_LOCK(s, summary_lock);
CAMEL_SUMMARY_LOCK(s, ref_lock);
-
+
info = g_hash_table_lookup (s->loaded_infos, uid);
- CAMEL_SUMMARY_UNLOCK(s, ref_lock);
- CAMEL_SUMMARY_UNLOCK(s, summary_lock);
-
if (!info) {
/* Makes no sense now as the exception is local as of now. FIXME: Pass exception from caller */
camel_exception_set (&ex, CAMEL_EXCEPTION_SYSTEM, _(g_strdup_printf ("no uid [%s] exists", uid)));
- return NULL;
}
}
- info->refcount++;
+ if (info)
+ info->refcount++;
+
+ CAMEL_SUMMARY_UNLOCK(s, ref_lock);
+ CAMEL_SUMMARY_UNLOCK(s, summary_lock);
return info;
}
@@ -1291,15 +1288,12 @@
#endif
/* Summary always holds a ref for the loaded infos */
- camel_message_info_ref(info); //FIXME: Check how things are loaded.
+ //camel_message_info_ref(info); //FIXME: Check how things are loaded.
#warning "FIXME: SHould we ref it or redesign it later on"
-
- d (g_print ("\n summary add: [%s]\n", camel_message_info_uid (info)));
-
/* The uid array should have its own memory. We will unload the infos when not reqd.*/
g_ptr_array_add (s->uids, g_strdup(camel_message_info_uid(info)));
- g_hash_table_insert (s->loaded_infos, g_strdup (camel_message_info_uid (info)), info);
+ g_hash_table_insert (s->loaded_infos, camel_message_info_uid (info), info);
s->flags |= CAMEL_SUMMARY_DIRTY;
CAMEL_SUMMARY_UNLOCK(s, summary_lock);
Modified: branches/camel-db-summary/camel/camel-folder-thread.c
==============================================================================
--- branches/camel-db-summary/camel/camel-folder-thread.c (original)
+++ branches/camel-db-summary/camel/camel-folder-thread.c Mon Jun 9 06:43:28 2008
@@ -623,8 +623,7 @@
for (i = 0 ; i < fsummary->len ; i++) {
CamelMessageInfo *info ;
- char *uid ;
- uid = fsummary->pdata[i];
+ char *uid = fsummary->pdata[i];
if (wanted == NULL || g_hash_table_lookup(wanted, uid) != NULL) {
info = camel_folder_get_message_info (folder, uid);
Modified: branches/camel-db-summary/camel/camel-folder.c
==============================================================================
--- branches/camel-db-summary/camel/camel-folder.c (original)
+++ branches/camel-db-summary/camel/camel-folder.c Mon Jun 9 06:43:28 2008
@@ -1095,14 +1095,27 @@
}
static GPtrArray *
-get_uids (CamelFolder *folder)
+get_uids(CamelFolder *folder)
{
GPtrArray *array;
int i, j, count;
+ array = g_ptr_array_new();
+
g_return_val_if_fail(folder->summary != NULL, array);
- array = camel_folder_summary_array (folder->summary);
+ count = camel_folder_summary_count(folder->summary);
+ g_ptr_array_set_size(array, count);
+ for (i = 0, j = 0; i < count; i++) {
+ CamelMessageInfo *info = camel_folder_summary_index(folder->summary, i);
+
+ if (info) {
+ array->pdata[j++] = g_strdup (camel_message_info_uid (info));
+ camel_message_info_free(info);
+ }
+ }
+
+ g_ptr_array_set_size (array, j);
return array;
}
Modified: branches/camel-db-summary/camel/camel-vee-summary.c
==============================================================================
--- branches/camel-db-summary/camel/camel-vee-summary.c (original)
+++ branches/camel-db-summary/camel/camel-vee-summary.c Mon Jun 9 06:43:28 2008
@@ -68,7 +68,6 @@
CamelMessageInfo *info;
gpointer p;
- g_print ("vee_info_ptr is : [%s]\n", mi->uid);
info = camel_folder_summary_uid (vmi->summary, mi->uid+8);
p = (gpointer) camel_message_info_ptr(info, id);
camel_message_info_free (info);
@@ -256,9 +255,7 @@
mi->info.uid = vuid;
- camel_folder_summary_add (&s->summary, (CamelMessageInfo *) mi);
-
- d (g_print ("Adding to vee summary : [%s]\n", ((CamelMessageInfo *) mi)->uid));
+ camel_folder_summary_add(&s->summary, (CamelMessageInfo *)mi);
return mi;
}
Modified: branches/camel-db-summary/camel/camel-vtrash-folder.c
==============================================================================
--- branches/camel-db-summary/camel/camel-vtrash-folder.c (original)
+++ branches/camel-db-summary/camel/camel-vtrash-folder.c Mon Jun 9 06:43:28 2008
@@ -133,7 +133,6 @@
case CAMEL_FOLDER_ARG_DELETED:
case CAMEL_FOLDER_ARG_JUNKED:
case CAMEL_FOLDER_ARG_VISIBLE:
- break;
/* This is so we can get the values atomically, and also so we can calculate them only once */
if (unread == -1) {
int j;
@@ -431,9 +430,9 @@
vinfo = (CamelVeeMessageInfo *)camel_folder_summary_uid(((CamelFolder *)vf)->summary, vuid);
if (vinfo == NULL) {
camel_vee_summary_add((CamelVeeSummary *)((CamelFolder *)vf)->summary, binfo->summary, uid, hash);
- //camel_folder_change_info_add_uid(((CamelVeeFolder *)vf)->changes, vuid);
+ camel_folder_change_info_add_uid(((CamelVeeFolder *)vf)->changes, vuid);
} else {
- //camel_folder_change_info_change_uid(((CamelVeeFolder *)vf)->changes, vuid);
+ camel_folder_change_info_change_uid(((CamelVeeFolder *)vf)->changes, vuid);
camel_message_info_free(vinfo);
}
}
@@ -442,7 +441,7 @@
vtrash_folder_changed(CamelVeeFolder *vf, CamelFolder *sub, CamelFolderChangeInfo *changes)
{
CamelMessageInfo *info;
- char hash[8] = { '\0', '\0', '\0', '\0', '\0', '\0', '\0' };
+ char hash[8];
CamelFolderChangeInfo *vf_changes = NULL;
int i;
@@ -512,8 +511,7 @@
infos = camel_folder_get_summary(sub);
for (i=0;i<infos->len;i++) {
CamelMessageInfo *info;
- char *uid ;
- uid = infos->pdata[i];
+ char *uid = infos->pdata[i];
info = camel_folder_summary_uid (sub->summary, uid);
if ((camel_message_info_flags(info) & ((CamelVTrashFolder *)vf)->bit))
vtrash_uid_added((CamelVTrashFolder *)vf, uid, info, hash);
Modified: branches/camel-db-summary/camel/camel-vtrash-folder.h
==============================================================================
--- branches/camel-db-summary/camel/camel-vtrash-folder.h (original)
+++ branches/camel-db-summary/camel/camel-vtrash-folder.h Mon Jun 9 06:43:28 2008
@@ -36,8 +36,8 @@
typedef struct _CamelVTrashFolder CamelVTrashFolder;
typedef struct _CamelVTrashFolderClass CamelVTrashFolderClass;
-#define CAMEL_VTRASH_NAME "evo_local/Trash"
-#define CAMEL_VJUNK_NAME "evo_local/Junk"
+#define CAMEL_VTRASH_NAME ".#evolution/Trash"
+#define CAMEL_VJUNK_NAME ".#evolution/Junk"
typedef enum _camel_vtrash_folder_t {
CAMEL_VTRASH_FOLDER_TRASH,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]