aboutsummaryrefslogtreecommitdiffstats
path: root/modules
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2013-06-21 23:03:25 +0800
committerMatthew Barnes <mbarnes@redhat.com>2013-06-21 23:06:16 +0800
commitf927a9a169f11f34171937172cade82c184fa022 (patch)
tree44c74595972cff71da47bf15ac31a9fe879d2aaa /modules
parent4a101290fdb546296f7bc0a9a34ba342e741895a (diff)
downloadgsoc2013-evolution-f927a9a169f11f34171937172cade82c184fa022.tar
gsoc2013-evolution-f927a9a169f11f34171937172cade82c184fa022.tar.gz
gsoc2013-evolution-f927a9a169f11f34171937172cade82c184fa022.tar.bz2
gsoc2013-evolution-f927a9a169f11f34171937172cade82c184fa022.tar.lz
gsoc2013-evolution-f927a9a169f11f34171937172cade82c184fa022.tar.xz
gsoc2013-evolution-f927a9a169f11f34171937172cade82c184fa022.tar.zst
gsoc2013-evolution-f927a9a169f11f34171937172cade82c184fa022.zip
Bug 702664 - Settings migration issue from "headers" to "show-headers"
Give the "show-headers" key a proper default value, and watch out for an empty "headers" key, which is supposed to imply that default value.
Diffstat (limited to 'modules')
-rw-r--r--modules/mail/em-mailer-prefs.c3
-rw-r--r--modules/settings/e-settings-deprecated.c8
2 files changed, 9 insertions, 2 deletions
diff --git a/modules/mail/em-mailer-prefs.c b/modules/mail/em-mailer-prefs.c
index 38e66b0002..5652487b2d 100644
--- a/modules/mail/em-mailer-prefs.c
+++ b/modules/mail/em-mailer-prefs.c
@@ -58,7 +58,8 @@ static GType col_types[] = {
#define EM_FORMAT_HEADER_XMAILER "x-evolution-mailer"
-/* temporarily copied from em-format.c */
+/* Keep this synchronized with the "show-headers" key
+ * in the "org.gnome.evolution.mail" GSettings schema. */
static const gchar *default_headers[] = {
N_("From"),
N_("Reply-To"),
diff --git a/modules/settings/e-settings-deprecated.c b/modules/settings/e-settings-deprecated.c
index 058c7fddd8..d22dbf99e8 100644
--- a/modules/settings/e-settings-deprecated.c
+++ b/modules/settings/e-settings-deprecated.c
@@ -120,6 +120,10 @@ settings_deprecated_header_strv_to_variant (gchar **strv)
length = g_strv_length (strv);
+ /* Disregard an empty list. */
+ if (length == 0)
+ return NULL;
+
g_variant_builder_init (&builder, G_VARIANT_TYPE ("a(sb)"));
for (ii = 0; ii < length; ii++)
@@ -519,7 +523,9 @@ settings_deprecated_constructed (GObject *object)
strv_value = g_settings_get_strv (priv->mail_settings, "headers");
variant = settings_deprecated_header_strv_to_variant (strv_value);
- g_settings_set_value (priv->mail_settings, "show-headers", variant);
+ if (variant != NULL)
+ g_settings_set_value (
+ priv->mail_settings, "show-headers", variant);
g_strfreev (strv_value);
/* XXX The "reply-style" key uses a completely different