]> spindle.queued.net Git - midori/commitdiff
Show decoded urls in the locationbar
authorAlexander Butenko <a.butenka@gmail.com>
Tue, 20 Jul 2010 18:38:04 +0000 (14:38 -0400)
committerChristian Dywan <christian@twotoasts.de>
Wed, 21 Jul 2010 21:19:29 +0000 (23:19 +0200)
midori/midori-locationaction.c

index 1f6ff2e9a5633d819fbd4e0e4e86309745dcce6f..de70b2c00a1fdebcd513ae4636b153adf10bcdc2 100644 (file)
@@ -446,6 +446,7 @@ midori_location_action_popup_timeout_cb (gpointer data)
     style = gtk_widget_get_style (action->treeview);
     while (result == SQLITE_ROW)
     {
+        gchar* unescaped_uri;
         sqlite3_int64 type = sqlite3_column_int64 (stmt, 0);
         const unsigned char* uri = sqlite3_column_text (stmt, 1);
         const unsigned char* title = sqlite3_column_text (stmt, 2);
@@ -453,9 +454,13 @@ midori_location_action_popup_timeout_cb (gpointer data)
         if (!icon)
             icon = action->default_icon;
         if (type == 1 /* history_view */)
+        {
+            unescaped_uri = g_uri_unescape_string ((const char*)uri, "");
             gtk_list_store_insert_with_values (store, NULL, matches,
-                URI_COL, uri, TITLE_COL, title, YALIGN_COL, 0.25,
+                URI_COL, unescaped_uri, TITLE_COL, title, YALIGN_COL, 0.25,
                 FAVICON_COL, icon, -1);
+            g_free (unescaped_uri);
+        }
         else if (type == 2 /* search_view */)
         {
             gchar* search_title = g_strdup_printf (_("Search for %s"), title);
@@ -1443,7 +1448,7 @@ midori_location_action_set_uri (MidoriLocationAction* location_action,
     g_return_if_fail (MIDORI_IS_LOCATION_ACTION (location_action));
     g_return_if_fail (uri != NULL);
 
-    katze_assign (location_action->uri, g_strdup (uri));
+    katze_assign (location_action->uri, g_uri_unescape_string (uri, ""));
 
     midori_location_action_set_text (location_action, uri);
 }