[gnome-utils] Don't save uri-escaped filenames



commit 817bd0aefd9473eb4da5f050cc32baf3f2243b60
Author: Matthias Clasen <mclasen redhat com>
Date:   Wed Aug 24 21:14:31 2011 -0400

    Don't save uri-escaped filenames
    
    We only want to uri-escape the filename when we are asked
    for an uri, not when we are asked for the filename.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=657248

 gnome-screenshot/screenshot-dialog.c |   13 ++++++-------
 1 files changed, 6 insertions(+), 7 deletions(-)
---
diff --git a/gnome-screenshot/screenshot-dialog.c b/gnome-screenshot/screenshot-dialog.c
index 9188bfb..dc09a8e 100644
--- a/gnome-screenshot/screenshot-dialog.c
+++ b/gnome-screenshot/screenshot-dialog.c
@@ -313,9 +313,12 @@ screenshot_dialog_get_uri (ScreenshotDialog *dialog)
 {
   gchar *folder, *file;
   gchar *uri;
+  gchar *tmp;
 
   folder = gtk_file_chooser_get_uri (GTK_FILE_CHOOSER (dialog->save_widget));
-  file = screenshot_dialog_get_filename (dialog);
+  tmp = screenshot_dialog_get_filename (dialog);
+  file = g_uri_escape_string (tmp, NULL, FALSE);
+  g_free (tmp);
   uri = g_build_filename (folder, file, NULL);
 
   g_free (folder);
@@ -334,7 +337,7 @@ char *
 screenshot_dialog_get_filename (ScreenshotDialog *dialog)
 {
   const gchar *file_name;
-  gchar *file, *tmp;
+  gchar *tmp;
   GError *error;
 
   file_name = gtk_entry_get_text (GTK_ENTRY (dialog->filename_entry));
@@ -351,11 +354,7 @@ screenshot_dialog_get_filename (ScreenshotDialog *dialog)
       tmp = g_strdup (_("Screenshot.png"));
     }
 
-  file = g_uri_escape_string (tmp, NULL, FALSE);
-
-  g_free (tmp);
-
-  return file;
+  return tmp;
 }
 
 GdkPixbuf *



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