[evolution] cal-config-webcal: Accept URIs with webcal:// scheme.



commit f2c79aa8f48fd04c7ce65d7dfdb6c85948ae448c
Author: Matthew Barnes <mbarnes redhat com>
Date:   Wed Aug 22 11:27:37 2012 -0400

    cal-config-webcal: Accept URIs with webcal:// scheme.
    
    webcal:// is a non-standard URI scheme, but still commonly used.
    We're using HTTP[S] regardless, so just accept it in the editor.

 .../evolution-cal-config-webcal.c                  |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)
---
diff --git a/modules/cal-config-webcal/evolution-cal-config-webcal.c b/modules/cal-config-webcal/evolution-cal-config-webcal.c
index 615afaa..2ca3550 100644
--- a/modules/cal-config-webcal/evolution-cal-config-webcal.c
+++ b/modules/cal-config-webcal/evolution-cal-config-webcal.c
@@ -162,6 +162,7 @@ cal_config_webcal_check_complete (ESourceConfigBackend *backend,
 	GtkEntry *entry;
 	Context *context;
 	const gchar *uri_string;
+	const gchar *scheme;
 	const gchar *uid;
 	gboolean complete;
 
@@ -173,6 +174,13 @@ cal_config_webcal_check_complete (ESourceConfigBackend *backend,
 	uri_string = gtk_entry_get_text (entry);
 
 	soup_uri = soup_uri_new (uri_string);
+
+	/* XXX webcal:// is a non-standard scheme, but we accept it.
+	 *     Just convert it to http:// for the URI validity test. */
+	scheme = soup_uri_get_scheme (soup_uri);
+	if (g_strcmp0 (scheme, "webcal") == 0)
+		soup_uri_set_scheme (soup_uri, SOUP_URI_SCHEME_HTTP);
+
 	complete = SOUP_URI_VALID_FOR_HTTP (soup_uri);
 
 	if (soup_uri != NULL)



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]