aboutsummaryrefslogtreecommitdiffstats
path: root/mail/message-list.c
diff options
context:
space:
mode:
authorNot Zed <NotZed@Ximian.com>2004-01-20 06:29:02 +0800
committerMichael Zucci <zucchi@src.gnome.org>2004-01-20 06:29:02 +0800
commitb2027c1a129cd5a8ea29f15596fafe9bdf8e8d94 (patch)
treecd1108b83c57b717dfc2e6a5a6597bb64e8c302f /mail/message-list.c
parent58f3de4588a027e43d0a40bb89ae00384d9d2037 (diff)
downloadgsoc2013-evolution-b2027c1a129cd5a8ea29f15596fafe9bdf8e8d94.tar
gsoc2013-evolution-b2027c1a129cd5a8ea29f15596fafe9bdf8e8d94.tar.gz
gsoc2013-evolution-b2027c1a129cd5a8ea29f15596fafe9bdf8e8d94.tar.bz2
gsoc2013-evolution-b2027c1a129cd5a8ea29f15596fafe9bdf8e8d94.tar.lz
gsoc2013-evolution-b2027c1a129cd5a8ea29f15596fafe9bdf8e8d94.tar.xz
gsoc2013-evolution-b2027c1a129cd5a8ea29f15596fafe9bdf8e8d94.tar.zst
gsoc2013-evolution-b2027c1a129cd5a8ea29f15596fafe9bdf8e8d94.zip
** See bug #52989.
2004-01-20 Not Zed <NotZed@Ximian.com> ** See bug #52989. * message-list.c (hide_load_state): clear the hidden table if setup, before loading. svn path=/trunk/; revision=24316
Diffstat (limited to 'mail/message-list.c')
-rw-r--r--mail/message-list.c20
1 files changed, 14 insertions, 6 deletions
diff --git a/mail/message-list.c b/mail/message-list.c
index 601a617ac1..ebd072cdc3 100644
--- a/mail/message-list.c
+++ b/mail/message-list.c
@@ -2989,16 +2989,23 @@ hide_load_state (MessageList *ml)
FILE *in;
guint32 version, lower, upper;
+ MESSAGE_LIST_LOCK(ml, hide_lock);
+ if (ml->hidden) {
+ g_hash_table_destroy (ml->hidden);
+ e_mempool_destroy (ml->hidden_pool);
+ ml->hidden = NULL;
+ ml->hidden_pool = NULL;
+ }
+ ml->hide_before = ML_HIDE_NONE_START;
+ ml->hide_after = ML_HIDE_NONE_END;
+
filename = mail_config_folder_to_cachename(ml->folder, "hidestate-");
in = fopen(filename, "r");
if (in) {
camel_file_util_decode_fixed_int32 (in, &version);
if (version == HIDE_STATE_VERSION) {
- MESSAGE_LIST_LOCK(ml, hide_lock);
- if (ml->hidden == NULL) {
- ml->hidden = g_hash_table_new(g_str_hash, g_str_equal);
- ml->hidden_pool = e_mempool_new(512, 256, E_MEMPOOL_ALIGN_BYTE);
- }
+ ml->hidden = g_hash_table_new(g_str_hash, g_str_equal);
+ ml->hidden_pool = e_mempool_new(512, 256, E_MEMPOOL_ALIGN_BYTE);
camel_file_util_decode_fixed_int32 (in, &lower);
ml->hide_before = lower;
camel_file_util_decode_fixed_int32 (in, &upper);
@@ -3012,11 +3019,12 @@ hide_load_state (MessageList *ml)
g_hash_table_insert(ml->hidden, uid, uid);
}
}
- MESSAGE_LIST_UNLOCK(ml, hide_lock);
}
fclose(in);
}
g_free(filename);
+
+ MESSAGE_LIST_UNLOCK(ml, hide_lock);
}
static void