From bc08fad238bd6a29c6ef68d966c99949321a4341 Mon Sep 17 00:00:00 2001 From: Christian Persch Date: Sat, 27 Mar 2004 13:02:24 +0000 Subject: Correctly disconnect the handler not from the proxy but from the entry 2004-03-27 Christian Persch * src/ephy-location-action.c: (location_url_activate_cb), (disconnect_proxy), (ephy_location_action_set_address): Correctly disconnect the handler not from the proxy but from the entry itself. Rationalise away one strdup. --- src/ephy-location-action.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'src/ephy-location-action.c') diff --git a/src/ephy-location-action.c b/src/ephy-location-action.c index 92d5af64a..2d64cb09b 100644 --- a/src/ephy-location-action.c +++ b/src/ephy-location-action.c @@ -129,16 +129,15 @@ action_activated_cb (GtkEntryCompletion *completion, } static void -location_url_activate_cb (EphyLocationEntry *entry, +location_url_activate_cb (GtkEntry *entry, EphyLocationAction *action) { - char *content; + const char *content; - content = gtk_editable_get_chars (GTK_EDITABLE(entry), 0, -1); + content = gtk_entry_get_text (entry); if (content) { g_signal_emit (action, signals[GO_LOCATION], 0, content); - g_free (content); } } @@ -291,11 +290,15 @@ disconnect_proxy (GtkAction *action, GtkWidget *proxy) if (EPHY_IS_LOCATION_ENTRY (proxy)) { + GtkWidget *entry; + + entry = GTK_BIN (proxy)->child; + g_signal_handlers_disconnect_by_func (action, G_CALLBACK (sync_address), proxy); g_signal_handlers_disconnect_by_func - (proxy, G_CALLBACK (location_url_activate_cb), action); + (entry, G_CALLBACK (location_url_activate_cb), action); g_signal_handlers_disconnect_by_func (proxy, G_CALLBACK (user_changed_cb), action); @@ -527,6 +530,6 @@ ephy_location_action_set_address (EphyLocationAction *action, LOG ("set_address %s", address) g_free (action->priv->address); - action->priv->address = g_strdup (address ? address : ""); + action->priv->address = g_strdup (address); g_object_notify (G_OBJECT (action), "address"); } -- cgit v1.2.3