icon = action->default_icon;
if (type == 1 /* history_view */)
{
- unescaped_uri = g_uri_unescape_string ((const char*)uri, "");
+ unescaped_uri = sokoke_uri_unescape_string ((const char*)uri);
+
gtk_list_store_insert_with_values (store, NULL, matches,
URI_COL, unescaped_uri, TITLE_COL, title, YALIGN_COL, 0.25,
FAVICON_COL, icon, -1);
return NULL;
}
+/**
+ * sokoke_uri_unescape_string:
+ * @uri: an URI string
+ *
+ * Unescape @uri if needed, and pass through '+'.
+ *
+ * Return value: a newly allocated URI
+ **/
+gchar*
+sokoke_uri_unescape_string (const gchar* uri)
+{
+ if (strchr (uri,'%'))
+ return g_uri_unescape_string (uri, "+");
+ return g_strdup (uri);
+}
+
/**
* sokoke_format_uri_for_display:
* @uri: an URI string
gchar*
sokoke_format_uri_for_display (const gchar* uri)
{
+ gchar* unescaped;
if (uri && g_str_has_prefix (uri, "http://"))
{
- gchar* unescaped = g_uri_unescape_string (uri, "+");
+ gchar* unescaped = sokoke_uri_unescape_string (uri);
#ifdef HAVE_LIBSOUP_2_27_90
gchar* path = NULL;
gchar* hostname;
gchar*
sokoke_magic_uri (const gchar* uri);
+gchar*
+sokoke_uri_unescape_string (const gchar* uri);
+
gchar*
sokoke_format_uri_for_display (const gchar* uri);