[evince] Shell: Unescape tooltip URI in Recent Documents view



commit f23f3d2ffb14eef3e87c5e21ec57d33717d33773
Author: Santurysim <santurysim gmail com>
Date:   Tue Oct 27 21:53:25 2020 +0300

    Shell: Unescape tooltip URI in Recent Documents view
    
    Currently, Evince shows escaped URIs of files in "Recent documents"
    view.
    
    However, non-ASCII in URI symbols are not shown correctly.
    
    To fix this, unescape URI before setting it as tooltip text.

 shell/ev-recent-view.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
---
diff --git a/shell/ev-recent-view.c b/shell/ev-recent-view.c
index 8b909558..7a426d37 100644
--- a/shell/ev-recent-view.c
+++ b/shell/ev-recent-view.c
@@ -205,6 +205,7 @@ on_query_tooltip_event (GtkWidget     *widget,
         GtkTreeIter          iter;
         GtkTreePath         *path = NULL;
         gchar               *uri;
+        gchar               *uri_unescaped;
 
         model = gtk_icon_view_get_model (GTK_ICON_VIEW (priv->view));
         if (!gtk_icon_view_get_tooltip_context (GTK_ICON_VIEW (priv->view),
@@ -216,9 +217,12 @@ on_query_tooltip_event (GtkWidget     *widget,
                             EV_RECENT_VIEW_COLUMN_URI, &uri,
                             -1);
 
-        gtk_tooltip_set_text (tooltip, uri);
+        uri_unescaped = g_uri_unescape_string (uri, NULL);
         g_free (uri);
 
+        gtk_tooltip_set_text (tooltip, uri_unescaped);
+        g_free (uri_unescaped);
+
         gtk_icon_view_set_tooltip_item (GTK_ICON_VIEW (priv->view),
                                         tooltip, path);
         gtk_tree_path_free (path);


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