[totem/gnome-2-28] Don't handle GtkLinkButton cliking ourselves



commit d7de19485c8a84a9ac8b8b896fba89e038229df7
Author: Bastien Nocera <hadess hadess net>
Date:   Thu Apr 8 13:51:24 2010 +0100

    Don't handle GtkLinkButton cliking ourselves
    
    GtkLinkButton already calls gtk_show_uri() itself when clicked,
    so no need to handle it ourselves.
    
    Should fix 2 web pages popping up (once for the URI hook, once for
    click handler), and avoid quoting problems.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=612579

 src/totem-interface.c |   35 -----------------------------------
 1 files changed, 0 insertions(+), 35 deletions(-)
---
diff --git a/src/totem-interface.c b/src/totem-interface.c
index dd6532b..046a6f1 100644
--- a/src/totem-interface.c
+++ b/src/totem-interface.c
@@ -122,40 +122,6 @@ totem_interface_error_blocking (const char *title, const char *reason,
 	gtk_widget_destroy (error_dialog);
 }
 
-static void
-link_button_clicked_cb (GtkWidget *widget, Totem *totem)
-{
-	const char *uri;
-	char *command, *browser, *escaped_uri;
-	GError *error = NULL;
-
-	uri = gtk_link_button_get_uri (GTK_LINK_BUTTON (widget));
-	escaped_uri = g_shell_quote (uri);
-	browser = gconf_client_get_string (totem->gc, "/desktop/gnome/url-handlers/http/command", NULL);
-
-	if (browser == NULL || browser[0] == '\0') {
-		char *message;
-
-		message = g_strdup_printf(_("Could not launch URL \"%s\": %s"), uri, _("Default browser not configured"));
-		totem_interface_error (_("Error launching URI"), message, GTK_WINDOW (totem->win));
-		g_free (message);
-	} else {
-		char *message;
-
-		command = g_strdup_printf (browser, escaped_uri);
-		if (g_spawn_command_line_async ((const char*) command, &error) == FALSE) {
-			message = g_strdup_printf(_("Could not launch URL \"%s\": %s"), uri, error->message);
-			totem_interface_error (_("Error launching URI"), message, GTK_WINDOW (totem->win));
-			g_free (message);
-			g_error_free (error);
-		}
-		g_free (command);
-	}
-
-	g_free (escaped_uri);
-	g_free (browser);
-}
-
 /**
  * totem_interface_error_with_link:
  * @title: the error title
@@ -179,7 +145,6 @@ totem_interface_error_with_link (const char *title, const char *reason,
 
 	error_dialog = totem_interface_error_dialog (title, reason, parent);
 	link_button = gtk_link_button_new_with_label (uri, label);
-	g_signal_connect (G_OBJECT (link_button), "clicked", G_CALLBACK (link_button_clicked_cb), totem);
 
 	hbox = gtk_hbox_new (TRUE, 0);
 	gtk_box_pack_start (GTK_BOX (hbox), link_button, FALSE, FALSE, 0);



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