diff options
author | Milan Crha <mcrha@redhat.com> | 2012-10-25 03:02:38 +0800 |
---|---|---|
committer | Milan Crha <mcrha@redhat.com> | 2012-10-25 03:02:38 +0800 |
commit | f641be538d33b29f6a104a0c4b7f7431c175177f (patch) | |
tree | 92b2f9e1ed4789bceac3144fc95d0869a6653799 /widgets | |
parent | 2bf86f8e806d2a8f4c630801680e6d020b71436f (diff) | |
download | gsoc2013-evolution-f641be538d33b29f6a104a0c4b7f7431c175177f.tar.gz gsoc2013-evolution-f641be538d33b29f6a104a0c4b7f7431c175177f.tar.zst gsoc2013-evolution-f641be538d33b29f6a104a0c4b7f7431c175177f.zip |
Bug #686785 - Port of WebDAV source doesn't match SSL check
Diffstat (limited to 'widgets')
-rw-r--r-- | widgets/misc/e-source-config.c | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/widgets/misc/e-source-config.c b/widgets/misc/e-source-config.c index f8b6252fe4..9b4ad13f26 100644 --- a/widgets/misc/e-source-config.c +++ b/widgets/misc/e-source-config.c @@ -1333,6 +1333,26 @@ e_source_config_add_secure_connection (ESourceConfig *config, G_BINDING_SYNC_CREATE); } +static gboolean +secure_to_port_cb (GBinding *binding, + const GValue *source_value, + GValue *target_value, + gpointer user_data) +{ + GObject *authentication_extension; + guint16 port; + + authentication_extension = g_binding_get_target (binding); + g_object_get (authentication_extension, "port", &port, NULL); + + if (port == 80 || port == 443 || port == 0) + port = g_value_get_boolean (source_value) ? 443 : 80; + + g_value_set_uint (target_value, port); + + return TRUE; +} + void e_source_config_add_secure_connection_for_webdav (ESourceConfig *config, ESource *scratch_source) @@ -1340,6 +1360,7 @@ e_source_config_add_secure_connection_for_webdav (ESourceConfig *config, GtkWidget *widget1; GtkWidget *widget2; ESourceExtension *extension; + ESourceAuthentication *authentication_extension; const gchar *extension_name; const gchar *label; @@ -1360,6 +1381,16 @@ e_source_config_add_secure_connection_for_webdav (ESourceConfig *config, G_BINDING_BIDIRECTIONAL | G_BINDING_SYNC_CREATE); + extension_name = E_SOURCE_EXTENSION_AUTHENTICATION; + authentication_extension = e_source_get_extension (scratch_source, extension_name); + + g_object_bind_property_full ( + extension, "secure", + authentication_extension, "port", + G_BINDING_DEFAULT, + secure_to_port_cb, + NULL, NULL, NULL); + extension_name = E_SOURCE_EXTENSION_WEBDAV_BACKEND; extension = e_source_get_extension (scratch_source, extension_name); |