[gtk+/gtk-2-24] Use UTF-8 encoding for tooltips on files in the "recently used" list



commit c9aadabe83d5a51a7df91c930910cecbb822be80
Author: Ingo Brückl <ib wupperonline de>
Date:   Mon Feb 13 01:00:51 2017 +0100

    Use UTF-8 encoding for tooltips on files in the "recently used" list
    
    g_file_get_path() returns the local pathname and it is entirely possible
    that this pathname isn't in UTF-8 encoding, but in a different one
    defined by G_FILENAME_ENCODING. Using a string in GLib file name
    encoding rather than UTF-8 encoding as tooltip text will produce an
    erroneous output.
    
    Use the parse name instead. This is a UTF-8 string that describes the
    file suitable for use in the user interface.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=778542

 gtk/gtkfilechooserdefault.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)
---
diff --git a/gtk/gtkfilechooserdefault.c b/gtk/gtkfilechooserdefault.c
index db097d4..8499a36 100644
--- a/gtk/gtkfilechooserdefault.c
+++ b/gtk/gtkfilechooserdefault.c
@@ -4206,7 +4206,7 @@ file_list_query_tooltip_cb (GtkWidget  *widget,
   GtkTreePath *path;
   GtkTreeIter iter;
   GFile *file;
-  gchar *filename;
+  char *parse_name;
 
   if (impl->operation_mode == OPERATION_MODE_BROWSE)
     return FALSE;
@@ -4228,13 +4228,13 @@ file_list_query_tooltip_cb (GtkWidget  *widget,
       return FALSE;
     }
 
-  filename = g_file_get_path (file);
-  gtk_tooltip_set_text (tooltip, filename);
+  parse_name = g_file_get_parse_name (file);
+  gtk_tooltip_set_text (tooltip, parse_name);
   gtk_tree_view_set_tooltip_row (GTK_TREE_VIEW (impl->browse_files_tree_view),
                                  tooltip,
                                  path);
 
-  g_free (filename);
+  g_free (parse_name);
   g_object_unref (file);
   gtk_tree_path_free (path);
 


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