[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.
This commit is contained in:
parent
42133f871f
commit
d5e168c81a
1 changed files with 3 additions and 3 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue