Updating branch refs/heads/master
         to f8bf87ecf97cb56f676b71d4b704453cfd5f568f (commit)
       from a770a1b488bc06abd658c2def6e328b3fea15e2c (commit)

commit f8bf87ecf97cb56f676b71d4b704453cfd5f568f
Author: Alexander Butenko <a.bute...@gmail.com>
Date:   Fri Jul 23 09:48:45 2010 -0400

    Dont unescape URIs which are not escaped
    
    sokoke_uri_unescape_string handles that and handles '+'
    the way we want.

 midori/midori-locationaction.c |    3 ++-
 midori/sokoke.c                |   19 ++++++++++++++++++-
 midori/sokoke.h                |    3 +++
 3 files changed, 23 insertions(+), 2 deletions(-)

diff --git a/midori/midori-locationaction.c b/midori/midori-locationaction.c
index 34772b2..29484d9 100644
--- a/midori/midori-locationaction.c
+++ b/midori/midori-locationaction.c
@@ -455,7 +455,8 @@ midori_location_action_popup_timeout_cb (gpointer data)
             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);
diff --git a/midori/sokoke.c b/midori/sokoke.c
index 99bc96e..909f711 100644
--- a/midori/sokoke.c
+++ b/midori/sokoke.c
@@ -738,6 +738,22 @@ sokoke_magic_uri (const gchar* uri)
 }
 
 /**
+ * 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
  *
@@ -749,9 +765,10 @@ sokoke_magic_uri (const gchar* uri)
 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;
diff --git a/midori/sokoke.h b/midori/sokoke.h
index 99d91e0..105aed0 100644
--- a/midori/sokoke.h
+++ b/midori/sokoke.h
@@ -114,6 +114,9 @@ gchar*
 sokoke_magic_uri                        (const gchar*    uri);
 
 gchar*
+sokoke_uri_unescape_string              (const gchar*    uri);
+
+gchar*
 sokoke_format_uri_for_display           (const gchar*    uri);
 
 void
_______________________________________________
Xfce4-commits mailing list
Xfce4-commits@xfce.org
http://foo-projects.org/mailman/listinfo/xfce4-commits

Reply via email to