aboutsummaryrefslogtreecommitdiffstats
path: root/widgets
diff options
context:
space:
mode:
authorMilan Crha <mcrha@redhat.com>2012-10-25 03:01:18 +0800
committerMilan Crha <mcrha@redhat.com>2012-10-25 03:01:18 +0800
commit529b5bf4a0f80eeebebe2fdb67a7fab4a146cb25 (patch)
treec59152e7c0857ddab5c91621f322d487c0ffcad2 /widgets
parent0c65652f2a3b29250b11425c594ded737a2a4cc5 (diff)
downloadgsoc2013-evolution-529b5bf4a0f80eeebebe2fdb67a7fab4a146cb25.tar.gz
gsoc2013-evolution-529b5bf4a0f80eeebebe2fdb67a7fab4a146cb25.tar.zst
gsoc2013-evolution-529b5bf4a0f80eeebebe2fdb67a7fab4a146cb25.zip
Bug #686785 - Port of WebDAV source doesn't match SSL check
Diffstat (limited to 'widgets')
-rw-r--r--widgets/misc/e-source-config.c31
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);