aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2013-07-18 04:35:44 +0800
committerMatthew Barnes <mbarnes@redhat.com>2013-07-18 04:35:44 +0800
commitf8f196ca0f73097664a2188df7537b2ba9e416ac (patch)
tree8e009a91acf0e4bd07ff925398a3b5e6956069b1
parentf37123906282e435526892954f4a0ce383ac0548 (diff)
downloadgsoc2013-evolution-f8f196ca0f73097664a2188df7537b2ba9e416ac.tar
gsoc2013-evolution-f8f196ca0f73097664a2188df7537b2ba9e416ac.tar.gz
gsoc2013-evolution-f8f196ca0f73097664a2188df7537b2ba9e416ac.tar.bz2
gsoc2013-evolution-f8f196ca0f73097664a2188df7537b2ba9e416ac.tar.lz
gsoc2013-evolution-f8f196ca0f73097664a2188df7537b2ba9e416ac.tar.xz
gsoc2013-evolution-f8f196ca0f73097664a2188df7537b2ba9e416ac.tar.zst
gsoc2013-evolution-f8f196ca0f73097664a2188df7537b2ba9e416ac.zip
Bug 704259 - Fix "reply-style" key migration logic
Apparently the migration logic was more complex than it needed to be. The old numeric key was already synced to the EMailReplyStyle enum in the source code. Dunno where I got the idea it wasn't. Just more evidence numeric enum keys are bad.
-rw-r--r--modules/settings/e-settings-deprecated.c57
1 files changed, 8 insertions, 49 deletions
diff --git a/modules/settings/e-settings-deprecated.c b/modules/settings/e-settings-deprecated.c
index 9e2d17615f..4b2e55009c 100644
--- a/modules/settings/e-settings-deprecated.c
+++ b/modules/settings/e-settings-deprecated.c
@@ -278,24 +278,10 @@ static void
settings_deprecated_reply_style_name_cb (GSettings *settings,
const gchar *key)
{
- /* XXX The "reply-style" key uses a completely different
- * numbering than the EMailReplyStyle enum. *sigh* */
- switch (g_settings_get_enum (settings, "reply-style-name")) {
- case E_MAIL_REPLY_STYLE_QUOTED:
- g_settings_set_int (settings, "reply-style", 2);
- break;
- case E_MAIL_REPLY_STYLE_DO_NOT_QUOTE:
- g_settings_set_int (settings, "reply-style", 3);
- break;
- case E_MAIL_REPLY_STYLE_ATTACH:
- g_settings_set_int (settings, "reply-style", 0);
- break;
- case E_MAIL_REPLY_STYLE_OUTLOOK:
- g_settings_set_int (settings, "reply-style", 1);
- break;
- default:
- g_warn_if_reached ();
- }
+ EMailReplyStyle style;
+
+ style = g_settings_get_enum (settings, "reply-style-name");
+ g_settings_set_int (settings, "reply-style", style);
}
static void
@@ -530,37 +516,10 @@ settings_deprecated_constructed (GObject *object)
g_settings_reset (priv->mail_settings, "show-headers");
g_strfreev (strv_value);
- /* XXX The "reply-style" key uses a completely different
- * numbering than the EMailReplyStyle enum. *sigh* */
- switch (g_settings_get_int (priv->mail_settings, "reply-style")) {
- case 0:
- g_settings_set_enum (
- priv->mail_settings,
- "reply-style-name",
- E_MAIL_REPLY_STYLE_ATTACH);
- break;
- case 1:
- g_settings_set_enum (
- priv->mail_settings,
- "reply-style-name",
- E_MAIL_REPLY_STYLE_OUTLOOK);
- break;
- case 2:
- g_settings_set_enum (
- priv->mail_settings,
- "reply-style-name",
- E_MAIL_REPLY_STYLE_QUOTED);
- break;
- case 3:
- g_settings_set_enum (
- priv->mail_settings,
- "reply-style-name",
- E_MAIL_REPLY_STYLE_DO_NOT_QUOTE);
- break;
- default:
- /* do nothing */
- break;
- }
+ int_value = g_settings_get_int (
+ priv->mail_settings, "reply-style");
+ g_settings_set_enum (
+ priv->mail_settings, "reply-style-name", int_value);
int_value = g_settings_get_int (
priv->mail_settings, "load-http-images");