[epiphany/wip/mcatanzaro/fedora-needs-upstreamed: 5/20] Properly display UTF-8 URLs in the location entry



commit f271904caa87a8b403809295d066b6990b6ec6d8
Author: Michael Catanzaro <mcatanzaro igalia com>
Date:   Wed Dec 10 20:38:49 2014 +0100

    Properly display UTF-8 URLs in the location entry
    
    https://bugzilla.gnome.org/show_bug.cgi?id=710004

 lib/widgets/ephy-location-entry.c |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)
---
diff --git a/lib/widgets/ephy-location-entry.c b/lib/widgets/ephy-location-entry.c
index 4d3ad89..82c04f1 100644
--- a/lib/widgets/ephy-location-entry.c
+++ b/lib/widgets/ephy-location-entry.c
@@ -1328,7 +1328,7 @@ ephy_location_entry_set_location (EphyLocationEntry *entry,
        GtkWidget *widget = GTK_WIDGET (entry);
        EphyLocationEntryPrivate *priv = entry->priv;
        GtkClipboard *clipboard;
-       const char *text;
+       char *text;
        char *effective_text = NULL, *selection = NULL;
        int start, end;
 
@@ -1357,7 +1357,7 @@ ephy_location_entry_set_location (EphyLocationEntry *entry,
                if (g_str_has_prefix (address, EPHY_ABOUT_SCHEME))
                        effective_text = g_strdup_printf ("about:%s",
                                                          address + strlen (EPHY_ABOUT_SCHEME) + 1);
-               text = address;
+               text = g_uri_unescape_string (address, NULL);
                gtk_entry_set_icon_drag_source (GTK_ENTRY (entry),
                                                GTK_ENTRY_ICON_PRIMARY,
                                                priv->drag_targets,
@@ -1365,7 +1365,7 @@ ephy_location_entry_set_location (EphyLocationEntry *entry,
        }
        else
        {
-               text = "";
+               text = g_strdup ("");
                gtk_entry_set_icon_drag_source (GTK_ENTRY (entry),
                                                GTK_ENTRY_ICON_PRIMARY,
                                                NULL,
@@ -1378,6 +1378,7 @@ ephy_location_entry_set_location (EphyLocationEntry *entry,
        priv->block_update = TRUE;
        gtk_entry_set_text (GTK_ENTRY (widget), effective_text ? effective_text : text);
        priv->block_update = FALSE;
+       g_free (text);
        g_free (effective_text);
 
        /* We need to call update_address_state() here, as the 'changed' signal


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