aboutsummaryrefslogtreecommitdiffstats
path: root/mail/mail-config.c
diff options
context:
space:
mode:
authorJeffrey Stedfast <fejj@ximian.com>2001-06-27 05:01:41 +0800
committerJeffrey Stedfast <fejj@src.gnome.org>2001-06-27 05:01:41 +0800
commite13e11965b4d62751bf6d50f5fc65c645e6f1e2b (patch)
tree70af380a99c5dd649a600ed3e2e0a9f79fdaeb32 /mail/mail-config.c
parent4fb01ff2ff50c15ddae5c676e616e77c98e09054 (diff)
downloadgsoc2013-evolution-e13e11965b4d62751bf6d50f5fc65c645e6f1e2b.tar
gsoc2013-evolution-e13e11965b4d62751bf6d50f5fc65c645e6f1e2b.tar.gz
gsoc2013-evolution-e13e11965b4d62751bf6d50f5fc65c645e6f1e2b.tar.bz2
gsoc2013-evolution-e13e11965b4d62751bf6d50f5fc65c645e6f1e2b.tar.lz
gsoc2013-evolution-e13e11965b4d62751bf6d50f5fc65c645e6f1e2b.tar.xz
gsoc2013-evolution-e13e11965b4d62751bf6d50f5fc65c645e6f1e2b.tar.zst
gsoc2013-evolution-e13e11965b4d62751bf6d50f5fc65c645e6f1e2b.zip
Helps if I spell "received" correctly.
2001-06-26 Jeffrey Stedfast <fejj@ximian.com> * folder-browser.c (my_folder_browser_init): Helps if I spell "received" correctly. * mail-config.c (mail_config_set_thread_list): If the value is already in the hash table, first remove it before setting the new value so we don't leak. (mail_config_set_show_preview): Same. svn path=/trunk/; revision=10510
Diffstat (limited to 'mail/mail-config.c')
-rw-r--r--mail/mail-config.c23
1 files changed, 18 insertions, 5 deletions
diff --git a/mail/mail-config.c b/mail/mail-config.c
index 7c65a5cacb..183c31436a 100644
--- a/mail/mail-config.c
+++ b/mail/mail-config.c
@@ -819,7 +819,6 @@ mail_config_is_configured (void)
gboolean
mail_config_get_show_preview (const char *uri)
{
- return TRUE;
if (uri) {
gboolean value = FALSE;
@@ -829,8 +828,8 @@ mail_config_get_show_preview (const char *uri)
value = GPOINTER_TO_INT (g_hash_table_lookup (config->preview_hash, uri));
if (!value) {
- /* just in case we got a NULL because it just wasn't in the hash table yet */
- gboolean def;
+ /* add the preference to the hash table */
+ gboolean def = FALSE;
char *str;
str = g_strdup_printf ("=%s/config/Mail=/Preview/%s", evolution_dir, uri);
@@ -855,9 +854,16 @@ void
mail_config_set_show_preview (const char *uri, gboolean value)
{
if (uri) {
+ gpointer key, val;
+
if (!config->preview_hash)
config->preview_hash = g_hash_table_new (g_str_hash, g_str_equal);
+ if (g_hash_table_lookup_extended (config->preview_hash, uri, &key, &val)) {
+ g_hash_table_remove (config->preview_hash, uri);
+ g_free (key);
+ }
+
g_hash_table_insert (config->preview_hash, g_strdup (uri), GINT_TO_POINTER (value));
} else
config->show_preview = value;
@@ -875,8 +881,8 @@ mail_config_get_thread_list (const char *uri)
value = GPOINTER_TO_INT (g_hash_table_lookup (config->threaded_hash, uri));
if (!value) {
- /* just in case we got a NULL because it just wasn't in the hash table yet */
- gboolean def;
+ /* add the preference to the hash table */
+ gboolean def = FALSE;
char *str;
str = g_strdup_printf ("=%s/config/Mail=/Threads/%s", evolution_dir, uri);
@@ -901,9 +907,16 @@ void
mail_config_set_thread_list (const char *uri, gboolean value)
{
if (uri) {
+ gpointer key, val;
+
if (!config->threaded_hash)
config->threaded_hash = g_hash_table_new (g_str_hash, g_str_equal);
+ if (g_hash_table_lookup_extended (config->threaded_hash, uri, &key, &val)) {
+ g_hash_table_remove (config->threaded_hash, uri);
+ g_free (key);
+ }
+
g_hash_table_insert (config->threaded_hash, g_strdup (uri), GINT_TO_POINTER (value));
} else
config->thread_list = value;