diff options
author | Diego Sevilla Ruiz <dsevilla@ditec.um.es> | 2004-11-12 23:43:48 +0800 |
---|---|---|
committer | Diego Sevilla Ruiz <dsevilla@src.gnome.org> | 2004-11-12 23:43:48 +0800 |
commit | 59d538eb71ab45f0aa792f579438fe72e33aa561 (patch) | |
tree | a2d9ac9ad54ac3f924d52faa5abb28a2bfd477b4 /plugins | |
parent | 79d6c1ff2a15947e8267b3de9816a67a08a2d63b (diff) | |
download | gsoc2013-evolution-59d538eb71ab45f0aa792f579438fe72e33aa561.tar.gz gsoc2013-evolution-59d538eb71ab45f0aa792f579438fe72e33aa561.tar.zst gsoc2013-evolution-59d538eb71ab45f0aa792f579438fe72e33aa561.zip |
Accept protocol-less URIs. Fixes #68264. (e_calendar_http_check): Fixed a
2004-11-12 Diego Sevilla Ruiz <dsevilla@ditec.um.es>
* calendar-http.c (e_calendar_http_check): Accept protocol-less
URIs. Fixes #68264.
(e_calendar_http_check): Fixed a memory leak.
(e_calendar_http_refresh): Another mem. leak fix.
svn path=/trunk/; revision=27905
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/calendar-http/ChangeLog | 8 | ||||
-rw-r--r-- | plugins/calendar-http/calendar-http.c | 24 |
2 files changed, 27 insertions, 5 deletions
diff --git a/plugins/calendar-http/ChangeLog b/plugins/calendar-http/ChangeLog index b65104d99b..7f9c5faa79 100644 --- a/plugins/calendar-http/ChangeLog +++ b/plugins/calendar-http/ChangeLog @@ -1,3 +1,10 @@ +2004-11-12 Diego Sevilla Ruiz <dsevilla@ditec.um.es> + + * calendar-http.c (e_calendar_http_check): Accept protocol-less + URIs. Fixes #68264. + (e_calendar_http_check): Fixed a memory leak. + (e_calendar_http_refresh): Another mem. leak fix. + 2004-11-09 Rodney Dawes <dobey@novell.com> * Makefile.am: Add EXTRA_DIST variable for the eplug.in file @@ -9,4 +16,3 @@ 2004-11-04 David Trowbridge <David.Trowbridge@Colorado.edu> * Initial import of webcal properties plugin. - diff --git a/plugins/calendar-http/calendar-http.c b/plugins/calendar-http/calendar-http.c index 6b076b02f3..cbc13193f3 100644 --- a/plugins/calendar-http/calendar-http.c +++ b/plugins/calendar-http/calendar-http.c @@ -1,5 +1,5 @@ /* - * + * * * Copyright (C) 2004 David Trowbridge * @@ -218,6 +218,7 @@ e_calendar_http_refresh (EPlugin *epl, EConfigHookItemFactoryData *data) ECalConfigTargetSource *t = (ECalConfigTargetSource *) data->target; ESource *source = t->source; EUri *uri; + char* uri_text; static GtkWidget *hidden = NULL; if (!hidden) @@ -226,13 +227,16 @@ e_calendar_http_refresh (EPlugin *epl, EConfigHookItemFactoryData *data) if (data->old) gtk_widget_destroy (label); - uri = e_uri_new (e_source_get_uri (t->source)); + uri_text = e_source_get_uri (t->source); + uri = e_uri_new (uri_text); if ((strcmp (uri->protocol, "http") && strcmp (uri->protocol, "webcal"))) { e_uri_free (uri); + g_free (uri_text); return hidden; } e_uri_free (uri); + g_free (uri_text); parent = data->parent; @@ -285,12 +289,24 @@ e_calendar_http_check (EPlugin *epl, EConfigHookPageCheckData *data) EUri *uri; gboolean ok = FALSE; ESourceGroup *group = e_source_peek_group (t->source); + char *uri_text; if (strcmp (e_source_group_peek_base_uri (group), "webcal")) return TRUE; - uri = e_uri_new (e_source_get_uri (t->source)); - ok = ((!strcmp (uri->protocol, "webcal")) || (!strcmp (uri->protocol, "http"))); + uri_text = e_source_get_uri (t->source); + if (!strncmp (uri_text, "file:", 5)) + { + g_free (uri_text); + return FALSE; + } + + uri = e_uri_new (uri_text); + ok = ((!strcmp (uri->protocol, "webcal")) || + (!strcmp (uri->protocol, "http")) || + (!strcmp (uri->protocol, "file")) ); e_uri_free (uri); + g_free (uri_text); + return ok; } |