aboutsummaryrefslogtreecommitdiffstats
path: root/camel/camel-vee-folder.c
diff options
context:
space:
mode:
Diffstat (limited to 'camel/camel-vee-folder.c')
-rw-r--r--camel/camel-vee-folder.c34
1 files changed, 22 insertions, 12 deletions
diff --git a/camel/camel-vee-folder.c b/camel/camel-vee-folder.c
index f7ceb12d59..e9f6e145f9 100644
--- a/camel/camel-vee-folder.c
+++ b/camel/camel-vee-folder.c
@@ -895,7 +895,8 @@ vee_folder_remove_folder(CamelVeeFolder *vf, CamelFolder *source, int killun)
char hash[8];
/*struct _CamelVeeFolderPrivate *p = _PRIVATE(vf);*/
CamelFolderChangeInfo *vf_changes = NULL, *unmatched_changes = NULL;
-
+ gpointer oldval;
+
if (vf == folder_unmatched)
return;
@@ -962,7 +963,8 @@ vee_folder_remove_folder(CamelVeeFolder *vf, CamelFolder *source, int killun)
}
if ((vf->flags & CAMEL_STORE_FOLDER_PRIVATE) == 0) {
if (still) {
- if (g_hash_table_lookup_extended(unmatched_uids, uid, (void **)&oldkey, (void **)&n)) {
+ if (g_hash_table_lookup_extended(unmatched_uids, uid, (void **)&oldkey, &oldval)) {
+ n = GPOINTER_TO_INT (oldval);
if (n == 1) {
g_hash_table_remove(unmatched_uids, oldkey);
if (vee_folder_add_uid(folder_unmatched, source, oldkey+8, hash))
@@ -973,7 +975,7 @@ vee_folder_remove_folder(CamelVeeFolder *vf, CamelFolder *source, int killun)
}
}
} else {
- if (g_hash_table_lookup_extended(unmatched_uids, camel_message_info_uid(mi), (void **)&oldkey, (void **)&n)) {
+ if (g_hash_table_lookup_extended(unmatched_uids, camel_message_info_uid(mi), (void **)&oldkey, &oldval)) {
g_hash_table_remove(unmatched_uids, oldkey);
g_free(oldkey);
}
@@ -1044,6 +1046,7 @@ static void
folder_added_uid(char *uidin, void *value, struct _update_data *u)
{
CamelVeeMessageInfo *mi;
+ gpointer oldval;
char *oldkey;
int n;
@@ -1051,7 +1054,8 @@ folder_added_uid(char *uidin, void *value, struct _update_data *u)
camel_folder_change_info_add_uid(u->vf->changes, camel_message_info_uid(mi));
if (!CAMEL_IS_VEE_FOLDER(u->source)) {
- if (g_hash_table_lookup_extended(unmatched_uids, camel_message_info_uid(mi), (void **)&oldkey, (void **)&n)) {
+ if (g_hash_table_lookup_extended(unmatched_uids, camel_message_info_uid(mi), (void **)&oldkey, &oldval)) {
+ n = GPOINTER_TO_INT (oldval);
g_hash_table_insert(unmatched_uids, oldkey, GINT_TO_POINTER(n+1));
} else {
g_hash_table_insert(unmatched_uids, g_strdup(camel_message_info_uid(mi)), GINT_TO_POINTER(1));
@@ -1094,13 +1098,13 @@ vee_folder_build_folder(CamelVeeFolder *vf, CamelFolder *source, CamelException
we just ref the real memory */
matchhash = g_hash_table_new(g_str_hash, g_str_equal);
for (i=0;i<match->len;i++)
- g_hash_table_insert(matchhash, match->pdata[i], (void *)1);
+ g_hash_table_insert(matchhash, match->pdata[i], GINT_TO_POINTER (1));
allhash = g_hash_table_new(g_str_hash, g_str_equal);
all = camel_folder_get_uids(f);
for (i=0;i<all->len;i++)
if (g_hash_table_lookup(matchhash, all->pdata[i]) == NULL)
- g_hash_table_insert(allhash, all->pdata[i], (void *)1);
+ g_hash_table_insert(allhash, all->pdata[i], GINT_TO_POINTER (1));
CAMEL_VEE_FOLDER_LOCK(folder_unmatched, summary_lock);
@@ -1114,7 +1118,8 @@ vee_folder_build_folder(CamelVeeFolder *vf, CamelFolder *source, CamelException
if (mi) {
if (mi->folder == source) {
char *uid = (char *)camel_message_info_uid(mi), *oldkey;
-
+ gpointer oldval;
+
if (g_hash_table_lookup(matchhash, uid+8) == NULL) {
if (last == -1) {
last = start = i;
@@ -1127,7 +1132,8 @@ vee_folder_build_folder(CamelVeeFolder *vf, CamelFolder *source, CamelException
}
camel_folder_change_info_remove_uid(vf->changes, camel_message_info_uid(mi));
if (!CAMEL_IS_VEE_FOLDER(source)
- && g_hash_table_lookup_extended(unmatched_uids, uid, (void **)&oldkey, (void **)&n)) {
+ && g_hash_table_lookup_extended(unmatched_uids, uid, (void **)&oldkey, &oldval)) {
+ n = GPOINTER_TO_INT (oldval);
if (n == 1) {
g_hash_table_remove(unmatched_uids, oldkey);
g_free(oldkey);
@@ -1223,6 +1229,7 @@ folder_changed_add_uid(CamelFolder *sub, const char *uid, const char hash[8], Ca
{
CamelVeeMessageInfo *vinfo;
const char *vuid;
+ gpointer oldval;
char *oldkey;
int n;
@@ -1234,10 +1241,11 @@ folder_changed_add_uid(CamelFolder *sub, const char *uid, const char hash[8], Ca
camel_folder_change_info_add_uid(vf->changes, vuid);
if ((vf->flags & CAMEL_STORE_FOLDER_PRIVATE) == 0 && !CAMEL_IS_VEE_FOLDER(sub)) {
- if (g_hash_table_lookup_extended(unmatched_uids, vuid, (void **)&oldkey, (void **)&n)) {
+ if (g_hash_table_lookup_extended(unmatched_uids, vuid, (void **)&oldkey, &oldval)) {
+ n = GPOINTER_TO_INT (oldval);
g_hash_table_insert(unmatched_uids, oldkey, GINT_TO_POINTER(n+1));
} else {
- g_hash_table_insert(unmatched_uids, g_strdup(vuid), (void *)1);
+ g_hash_table_insert(unmatched_uids, g_strdup(vuid), GINT_TO_POINTER (1));
}
vinfo = (CamelVeeMessageInfo *)camel_folder_get_message_info((CamelFolder *)folder_unmatched, vuid);
if (vinfo) {
@@ -1253,6 +1261,7 @@ folder_changed_remove_uid(CamelFolder *sub, const char *uid, const char hash[8],
{
CamelFolder *folder = (CamelFolder *)vf;
char *vuid, *oldkey;
+ gpointer oldval;
int n;
CamelVeeMessageInfo *vinfo;
@@ -1269,7 +1278,8 @@ folder_changed_remove_uid(CamelFolder *sub, const char *uid, const char hash[8],
if ((vf->flags & CAMEL_STORE_FOLDER_PRIVATE) == 0 && !CAMEL_IS_VEE_FOLDER(sub)) {
if (keep) {
- if (g_hash_table_lookup_extended(unmatched_uids, vuid, (void **)&oldkey, (void **)&n)) {
+ if (g_hash_table_lookup_extended(unmatched_uids, vuid, (void **)&oldkey, &oldval)) {
+ n = GPOINTER_TO_INT (oldval);
if (n == 1) {
g_hash_table_remove(unmatched_uids, oldkey);
if (vee_folder_add_uid(folder_unmatched, sub, uid, hash))
@@ -1283,7 +1293,7 @@ folder_changed_remove_uid(CamelFolder *sub, const char *uid, const char hash[8],
camel_folder_change_info_add_uid(folder_unmatched->changes, oldkey);
}
} else {
- if (g_hash_table_lookup_extended(unmatched_uids, vuid, (void **)&oldkey, (void **)&n)) {
+ if (g_hash_table_lookup_extended(unmatched_uids, vuid, (void **)&oldkey, &oldval)) {
g_hash_table_remove(unmatched_uids, oldkey);
g_free(oldkey);
}