[gnome-control-center/gnome-2-28] [font-viewer] Don't use URI notation when installing fonts



commit f5db68ec094f1419063bdc11dbf9e5a6de24e0d4
Author: Jens Granseuer <jensgr gmx net>
Date:   Sat Dec 5 12:52:36 2009 +0100

    [font-viewer] Don't use URI notation when installing fonts
    
    The code treated a URI as a path which would result in escaped
    characters showing up as "%20" and such in the destination file
    name. Be more careful to treat URIs as URIs and paths as paths.
    
    Closes bug #603732.

 font-viewer/font-view.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/font-viewer/font-view.c b/font-viewer/font-view.c
index 336ecf2..ec71129 100644
--- a/font-viewer/font-view.c
+++ b/font-viewer/font-view.c
@@ -474,14 +474,14 @@ install_button_clicked_cb (GtkButton   *button,
     g_free (dest_path);
 
     /* create destination filename */
-    dest_filename = g_path_get_basename (font_file);
+    src = g_file_new_for_uri (font_file);
+
+    dest_filename = g_file_get_basename (src);
     dest_path = g_build_filename (g_get_home_dir (), ".fonts", dest_filename, NULL);
     g_free (dest_filename);
 
     dest = g_file_new_for_path (dest_path);
 
-    src = g_file_new_for_uri (font_file);
-
     /* TODO: show error dialog if file exists */
     g_file_copy_async (src, dest, G_FILE_COPY_NONE, 0, NULL, NULL, NULL,
                        font_install_finished_cb, button);



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