aboutsummaryrefslogtreecommitdiffstats
path: root/modules/settings
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2013-03-11 08:11:48 +0800
committerMatthew Barnes <mbarnes@redhat.com>2013-03-17 20:49:12 +0800
commit69cf1ede0d8dbeee486fd3693fba42f2ccea8bf6 (patch)
tree77a2f75d2abf1f1c030bac6ec5c568f1af33d04b /modules/settings
parent54bb7dd76c8c698eb69bd7460cf74551c182b439 (diff)
downloadgsoc2013-evolution-69cf1ede0d8dbeee486fd3693fba42f2ccea8bf6.tar
gsoc2013-evolution-69cf1ede0d8dbeee486fd3693fba42f2ccea8bf6.tar.gz
gsoc2013-evolution-69cf1ede0d8dbeee486fd3693fba42f2ccea8bf6.tar.bz2
gsoc2013-evolution-69cf1ede0d8dbeee486fd3693fba42f2ccea8bf6.tar.lz
gsoc2013-evolution-69cf1ede0d8dbeee486fd3693fba42f2ccea8bf6.tar.xz
gsoc2013-evolution-69cf1ede0d8dbeee486fd3693fba42f2ccea8bf6.tar.zst
gsoc2013-evolution-69cf1ede0d8dbeee486fd3693fba42f2ccea8bf6.zip
Add "image-loading-policy" setting.
Replaces the "load-http-images" setting, which is now deprecated. The new setting uses an enum type compatible with EMailImageLoadingPolicy.
Diffstat (limited to 'modules/settings')
-rw-r--r--modules/settings/e-settings-deprecated.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/modules/settings/e-settings-deprecated.c b/modules/settings/e-settings-deprecated.c
index f7b21ae573..b42952f67c 100644
--- a/modules/settings/e-settings-deprecated.c
+++ b/modules/settings/e-settings-deprecated.c
@@ -44,6 +44,7 @@ struct _ESettingsDeprecatedPrivate {
GSettings *mail_settings;
gulong forward_style_name_handler_id;
gulong reply_style_name_handler_id;
+ gulong image_loading_policy_handler_id;
};
/* Flag values used in the "working-days" key. */
@@ -207,6 +208,16 @@ settings_deprecated_reply_style_name_cb (GSettings *settings,
}
static void
+settings_deprecated_image_loading_policy_cb (GSettings *settings,
+ const gchar *key)
+{
+ EMailImageLoadingPolicy policy;
+
+ policy = g_settings_get_enum (settings, "image-loading-policy");
+ g_settings_set_int (settings, "load-http-images", policy);
+}
+
+static void
settings_deprecated_dispose (GObject *object)
{
ESettingsDeprecatedPrivate *priv;
@@ -283,6 +294,13 @@ settings_deprecated_dispose (GObject *object)
priv->reply_style_name_handler_id = 0;
}
+ if (priv->image_loading_policy_handler_id > 0) {
+ g_signal_handler_disconnect (
+ priv->mail_settings,
+ priv->image_loading_policy_handler_id);
+ priv->image_loading_policy_handler_id = 0;
+ }
+
g_clear_object (&priv->calendar_settings);
g_clear_object (&priv->mail_settings);
@@ -372,6 +390,11 @@ settings_deprecated_constructed (GObject *object)
break;
}
+ int_value = g_settings_get_int (
+ priv->mail_settings, "load-http-images");
+ g_settings_set_enum (
+ priv->mail_settings, "image-loading-policy", int_value);
+
/* Write changes back to the deprecated keys. */
handler_id = g_signal_connect (
@@ -423,6 +446,10 @@ settings_deprecated_constructed (GObject *object)
priv->mail_settings, "changed::reply-style-name",
G_CALLBACK (settings_deprecated_reply_style_name_cb), NULL);
priv->reply_style_name_handler_id = handler_id;
+
+ handler_id = g_signal_connect (
+ priv->mail_settings, "changed::image-loading-policy",
+ G_CALLBACK (settings_deprecated_image_loading_policy_cb), NULL);
}
static void