[gnome-shell] screenshot: use g_file_replace() when using an absolute path



commit e4860acb5815d245c00554367d6ffcd18a7523b7
Author: Cosimo Cecchi <cosimoc gnome org>
Date:   Thu Jan 3 15:02:00 2013 +0100

    screenshot: use g_file_replace() when using an absolute path
    
    Instead of g_file_create(), which always fails if the file exists
    already.

 src/shell-screenshot.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/src/shell-screenshot.c b/src/shell-screenshot.c
index 4078ccd..2914e07 100644
--- a/src/shell-screenshot.c
+++ b/src/shell-screenshot.c
@@ -153,7 +153,7 @@ prepare_write_stream (const gchar *filename,
     {
       file = g_file_new_for_path (filename);
       *filename_used = g_strdup (filename);
-      stream = G_OUTPUT_STREAM (g_file_create (file, G_FILE_CREATE_NONE, NULL, NULL));
+      stream = G_OUTPUT_STREAM (g_file_replace (file, NULL, FALSE, G_FILE_CREATE_NONE, NULL, NULL));
       g_object_unref (file);
     }
   else



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