aboutsummaryrefslogtreecommitdiffstats
path: root/mail/e-mail-migrate.c
diff options
context:
space:
mode:
authorMilan Crha <mcrha@redhat.com>2010-09-03 18:04:03 +0800
committerMilan Crha <mcrha@redhat.com>2010-09-03 18:04:03 +0800
commitaa61df95271d9daa2eceb443de8e741c004528ea (patch)
tree20349f60e34a16ae5dd75e2b5f6f07e9025430f6 /mail/e-mail-migrate.c
parent45625d0ce9212bd65fc67f6bed38bcd72754f8bd (diff)
downloadgsoc2013-evolution-aa61df95271d9daa2eceb443de8e741c004528ea.tar
gsoc2013-evolution-aa61df95271d9daa2eceb443de8e741c004528ea.tar.gz
gsoc2013-evolution-aa61df95271d9daa2eceb443de8e741c004528ea.tar.bz2
gsoc2013-evolution-aa61df95271d9daa2eceb443de8e741c004528ea.tar.lz
gsoc2013-evolution-aa61df95271d9daa2eceb443de8e741c004528ea.tar.xz
gsoc2013-evolution-aa61df95271d9daa2eceb443de8e741c004528ea.tar.zst
gsoc2013-evolution-aa61df95271d9daa2eceb443de8e741c004528ea.zip
Bug #580623 - Mishandling of evolution's proxy ignore_hosts key
Diffstat (limited to 'mail/e-mail-migrate.c')
-rw-r--r--mail/e-mail-migrate.c61
1 files changed, 61 insertions, 0 deletions
diff --git a/mail/e-mail-migrate.c b/mail/e-mail-migrate.c
index 202bbaaca5..03b441b577 100644
--- a/mail/e-mail-migrate.c
+++ b/mail/e-mail-migrate.c
@@ -719,6 +719,63 @@ migrate_to_db (EShellBackend *shell_backend)
#endif
+static void
+em_ensure_proxy_ignore_hosts_being_list (void)
+{
+ const gchar *key = "/apps/evolution/shell/network_config/ignore_hosts";
+ GConfClient *client;
+ GConfValue *key_value;
+
+ /* makes sure the 'key' is a list of strings, not a string, as set by previous versions */
+
+ client = gconf_client_get_default ();
+ key_value = gconf_client_get (client, key, NULL);
+ if (key_value && key_value->type == GCONF_VALUE_STRING) {
+ gchar *value = gconf_client_get_string (client, key, NULL);
+ GSList *lst = NULL;
+ GError *error = NULL;
+
+ if (value && *value) {
+ gchar **split = g_strsplit (value, ",", -1);
+
+ if (split) {
+ gint ii;
+
+ for (ii = 0; split[ii]; ii++) {
+ const gchar *tmp = split[ii];
+
+ if (tmp && *tmp) {
+ gchar *val = g_strstrip (g_strdup (tmp));
+
+ if (val && *val)
+ lst = g_slist_append (lst, val);
+ else
+ g_free (val);
+ }
+ }
+ }
+
+ g_strfreev (split);
+ }
+
+ gconf_client_unset (client, key, NULL);
+ gconf_client_set_list (client, key, GCONF_VALUE_STRING, lst, &error);
+
+ g_slist_foreach (lst, (GFunc) g_free, NULL);
+ g_slist_free (lst);
+ g_free (value);
+
+ if (error) {
+ fprintf (stderr, "%s: Failed to set a list values with error: %s\n", G_STRFUNC, error->message);
+ g_error_free (error);
+ }
+ }
+
+ if (key_value)
+ gconf_value_free (key_value);
+ g_object_unref (client);
+}
+
gboolean
e_mail_migrate (EShellBackend *shell_backend,
gint major,
@@ -769,5 +826,9 @@ e_mail_migrate (EShellBackend *shell_backend,
#endif
}
+ if (major < 2 || (major == 2 && minor < 32)) {
+ em_ensure_proxy_ignore_hosts_being_list ();
+ }
+
return TRUE;
}