From e6945b6c75103866ac890219e93463ff4ce06183 Mon Sep 17 00:00:00 2001 From: Diego Escalante Urrelo Date: Sat, 30 Jul 2011 19:07:16 -0500 Subject: Use g_markup_printf_escaped when printing uris This covers GtkInfoBar in ephy-web-view.c, ephy-download-widget.c and also tooltips and labels in ephy-download-widget.c Bug #649164 --- embed/ephy-web-view.c | 10 +++++----- lib/widgets/ephy-download-widget.c | 7 ++----- 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/embed/ephy-web-view.c b/embed/ephy-web-view.c index 6f78d4f68..b4aca442d 100644 --- a/embed/ephy-web-view.c +++ b/embed/ephy-web-view.c @@ -763,9 +763,9 @@ request_decision_on_storing (StorePasswordData *store_data) * hostname where this is happening. Example: gnome@gmail.com and * mail.google.com. */ - message = g_strdup_printf (_("Would you like to store the password for %s in %s?"), - store_data->name_value, - hostname); + message = g_markup_printf_escaped (_("Would you like to store the password for %s in %s?"), + store_data->name_value, + hostname); gtk_label_set_markup (GTK_LABEL (label), message); g_free (hostname); g_free (message); @@ -1732,8 +1732,8 @@ geolocation_policy_decision_requested_cb (WebKitWebView *web_view, G_CALLBACK (send_yes_response_cb), info_bar); /* Label */ - message = g_strdup_printf (_("The page at %s wants to know your location."), - webkit_web_frame_get_uri (web_frame)); + message = g_markup_printf_escaped (_("The page at %s wants to know your location."), + webkit_web_frame_get_uri (web_frame)); label = gtk_label_new (message); g_object_set (label, "use-markup", TRUE, NULL); diff --git a/lib/widgets/ephy-download-widget.c b/lib/widgets/ephy-download-widget.c index ab52e4e72..084116804 100644 --- a/lib/widgets/ephy-download-widget.c +++ b/lib/widgets/ephy-download-widget.c @@ -153,7 +153,6 @@ widget_progress_cb (GObject *object, EphyDownloadWidget *widget) { WebKitDownload *download; - char *file; char *destination; gdouble time; char *remaining; @@ -162,8 +161,7 @@ widget_progress_cb (GObject *object, char *remaining_tooltip; download = WEBKIT_DOWNLOAD (object); - file = g_filename_display_basename (webkit_download_get_destination_uri (download)); - destination = g_uri_unescape_string (file, NULL); + destination = g_filename_display_basename (webkit_download_get_destination_uri (download)); progress = webkit_download_get_progress (download) * 100; time = get_remaining_time (download); @@ -174,12 +172,11 @@ widget_progress_cb (GObject *object, remaining = g_strdup (_("Finished")); remaining_label = g_strdup_printf ("%d%% (%s)", progress, remaining); - remaining_tooltip = g_strdup_printf ("%s\n%s", destination, remaining_label); + remaining_tooltip = g_markup_printf_escaped ("%s\n%s", destination, remaining_label); gtk_label_set_text (GTK_LABEL (widget->priv->remaining), remaining_label); gtk_widget_set_tooltip_text (GTK_WIDGET (widget), remaining_tooltip); - g_free (file); g_free (destination); g_free (remaining); g_free (remaining_label); -- cgit v1.2.3