aboutsummaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
authorDiego Sevilla Ruiz <dsevilla@ditec.um.es>2004-11-14 18:46:23 +0800
committerDiego Sevilla Ruiz <dsevilla@src.gnome.org>2004-11-14 18:46:23 +0800
commit8ef8d629472c8091da468f3eb828554de511573a (patch)
treefd2603ec5acd8d2d70ccc0d967bfceb01526ed74 /plugins
parent45627a703f6ff9b67b3612645b77b7521096d60f (diff)
downloadgsoc2013-evolution-8ef8d629472c8091da468f3eb828554de511573a.tar
gsoc2013-evolution-8ef8d629472c8091da468f3eb828554de511573a.tar.gz
gsoc2013-evolution-8ef8d629472c8091da468f3eb828554de511573a.tar.bz2
gsoc2013-evolution-8ef8d629472c8091da468f3eb828554de511573a.tar.lz
gsoc2013-evolution-8ef8d629472c8091da468f3eb828554de511573a.tar.xz
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')
-rw-r--r--plugins/calendar-http/ChangeLog1
-rw-r--r--plugins/calendar-http/calendar-http.c18
2 files changed, 11 insertions, 8 deletions
diff --git a/plugins/calendar-http/ChangeLog b/plugins/calendar-http/ChangeLog
index 7f9c5faa79..28a0aa9012 100644
--- a/plugins/calendar-http/ChangeLog
+++ b/plugins/calendar-http/ChangeLog
@@ -4,6 +4,7 @@
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.
2004-11-09 Rodney Dawes <dobey@novell.com>
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;
}