aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMilan Crha <mcrha@redhat.com>2008-08-12 20:37:10 +0800
committerMilan Crha <mcrha@src.gnome.org>2008-08-12 20:37:10 +0800
commite01e6e3c5535ea63493385a1a8f22438f64ba9e3 (patch)
tree26ae7c93f5d5c99561957b9590bc565ff1ea3292
parent02e06ac617b2c205be9552e0d121800f4f98e86c (diff)
downloadgsoc2013-evolution-e01e6e3c5535ea63493385a1a8f22438f64ba9e3.tar.gz
gsoc2013-evolution-e01e6e3c5535ea63493385a1a8f22438f64ba9e3.tar.zst
gsoc2013-evolution-e01e6e3c5535ea63493385a1a8f22438f64ba9e3.zip
** Fix for bug #519292
2008-08-12 Milan Crha <mcrha@redhat.com> ** Fix for bug #519292 * message-list.c: (read_boolean_with_default), (message_list_construct): Read 'thread_expand' and 'thread_latest' safely with TRUE as default if key doesn't exist. svn path=/trunk/; revision=35968
-rw-r--r--mail/ChangeLog8
-rw-r--r--mail/message-list.c27
2 files changed, 31 insertions, 4 deletions
diff --git a/mail/ChangeLog b/mail/ChangeLog
index 84dff3cac6..917ee5ddb4 100644
--- a/mail/ChangeLog
+++ b/mail/ChangeLog
@@ -1,3 +1,11 @@
+2008-08-12 Milan Crha <mcrha@redhat.com>
+
+ ** Fix for bug #519292
+
+ * message-list.c: (read_boolean_with_default),
+ (message_list_construct): Read 'thread_expand' and 'thread_latest'
+ safely with TRUE as default if key doesn't exist.
+
2008-08-11 Matthew Barnes <mbarnes@redhat.com>
** Fixes part of bug #546892
diff --git a/mail/message-list.c b/mail/message-list.c
index 3f43f58cb6..4382b0bd82 100644
--- a/mail/message-list.c
+++ b/mail/message-list.c
@@ -2373,6 +2373,25 @@ message_list_class_init (MessageListClass *message_list_class)
message_list_init_images ();
}
+static gboolean
+read_boolean_with_default (GConfClient *gconf, const char *key, gboolean def_value)
+{
+ GConfValue *value;
+ gboolean res;
+
+ g_return_val_if_fail (gconf != NULL, def_value);
+ g_return_val_if_fail (key != NULL, def_value);
+
+ value = gconf_client_get (gconf, key, NULL);
+ if (!value)
+ return def_value;
+
+ res = gconf_value_get_bool (value);
+ gconf_value_free (value);
+
+ return res;
+}
+
static void
message_list_construct (MessageList *message_list)
{
@@ -2406,11 +2425,11 @@ message_list_construct (MessageList *message_list)
message_list);
e_tree_memory_set_expanded_default(E_TREE_MEMORY(message_list->model),
- gconf_client_get_bool (gconf,
- "/apps/evolution/mail/display/thread_expand",
- NULL));
+ read_boolean_with_default (gconf,
+ "/apps/evolution/mail/display/thread_expand",
+ TRUE));
- message_list->priv->thread_latest = gconf_client_get_bool (gconf, "/apps/evolution/mail/display/thread_latest", NULL);
+ message_list->priv->thread_latest = read_boolean_with_default (gconf, "/apps/evolution/mail/display/thread_latest", TRUE);
/*
* The etree