diff options
author | Diego Sevilla Ruiz <dsevilla@ditec.um.es> | 2004-11-14 18:46:23 +0800 |
---|---|---|
committer | Diego Sevilla Ruiz <dsevilla@src.gnome.org> | 2004-11-14 18:46:23 +0800 |
commit | 8ef8d629472c8091da468f3eb828554de511573a (patch) | |
tree | fd2603ec5acd8d2d70ccc0d967bfceb01526ed74 /plugins/calendar-http/calendar-http.c | |
parent | 45627a703f6ff9b67b3612645b77b7521096d60f (diff) | |
download | gsoc2013-evolution-8ef8d629472c8091da468f3eb828554de511573a.tar.gz gsoc2013-evolution-8ef8d629472c8091da468f3eb828554de511573a.tar.zst gsoc2013-evolution-8ef8d629472c8091da468f3eb828554de511573a.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.
(e_calendar_http_url): Fixed another more memory leak.
svn path=/trunk/; revision=27913
Diffstat (limited to 'plugins/calendar-http/calendar-http.c')
-rw-r--r-- | plugins/calendar-http/calendar-http.c | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/plugins/calendar-http/calendar-http.c b/plugins/calendar-http/calendar-http.c index cbc13193f3..6621006326 100644 --- a/plugins/calendar-http/calendar-http.c +++ b/plugins/calendar-http/calendar-http.c @@ -94,6 +94,7 @@ e_calendar_http_url (EPlugin *epl, EConfigHookItemFactoryData *data) int row; ECalConfigTargetSource *t = (ECalConfigTargetSource *) data->target; EUri *uri; + char *uri_text; static GtkWidget *hidden = NULL; if (!hidden) @@ -102,10 +103,12 @@ e_calendar_http_url (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); @@ -121,11 +124,12 @@ e_calendar_http_url (EPlugin *epl, EConfigHookItemFactoryData *data) entry = gtk_entry_new (); gtk_widget_show (entry); - gtk_entry_set_text (GTK_ENTRY (entry), e_source_get_uri (t->source)); + gtk_entry_set_text (GTK_ENTRY (entry), uri_text); gtk_table_attach (GTK_TABLE (parent), entry, 1, 2, row, row+1, GTK_EXPAND | GTK_FILL, 0, 0, 0); gtk_label_set_mnemonic_widget (GTK_LABEL (label), entry); g_signal_connect (G_OBJECT (entry), "changed", G_CALLBACK (url_changed), t->source); + g_free (uri_text); return entry; } @@ -229,14 +233,13 @@ e_calendar_http_refresh (EPlugin *epl, EConfigHookItemFactoryData *data) uri_text = e_source_get_uri (t->source); uri = e_uri_new (uri_text); + g_free (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; @@ -295,18 +298,17 @@ e_calendar_http_check (EPlugin *epl, EConfigHookPageCheckData *data) return TRUE; uri_text = e_source_get_uri (t->source); - if (!strncmp (uri_text, "file:", 5)) - { + 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; } |