[gnome-screenshot] Make screenshot-filename-builder stand-alone



commit 3aa43ce7b710e97ec9b1478c0fe6563a8d8c7440
Author: Bastien Nocera <hadess hadess net>
Date:   Thu Jun 28 10:08:12 2012 +0100

    Make screenshot-filename-builder stand-alone
    
    So it could be reused in other applications.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=679054

 src/screenshot-application.c      |    2 +-
 src/screenshot-filename-builder.c |    7 +++----
 src/screenshot-filename-builder.h |    3 ++-
 3 files changed, 6 insertions(+), 6 deletions(-)
---
diff --git a/src/screenshot-application.c b/src/screenshot-application.c
index bba46d9..9ea6e91 100644
--- a/src/screenshot-application.c
+++ b/src/screenshot-application.c
@@ -433,7 +433,7 @@ finish_prepare_screenshot (ScreenshotApplication *self,
       screenshot_save_to_file (self);
     }
   else
-    screenshot_build_filename_async (build_filename_ready_cb, self);
+    screenshot_build_filename_async (screenshot_config->save_dir, build_filename_ready_cb, self);
 }
 
 static void
diff --git a/src/screenshot-filename-builder.c b/src/screenshot-filename-builder.c
index e143694..e6c6174 100644
--- a/src/screenshot-filename-builder.c
+++ b/src/screenshot-filename-builder.c
@@ -24,8 +24,6 @@
 #include <pwd.h>
 #include <string.h>
 
-#include "screenshot-config.h"
-
 typedef enum
 {
   TEST_SAVED_DIR = 0,
@@ -288,14 +286,15 @@ out:
 }
 
 void
-screenshot_build_filename_async (GAsyncReadyCallback callback,
+screenshot_build_filename_async (const char *save_dir,
+                                 GAsyncReadyCallback callback,
                                  gpointer user_data)
 {
   AsyncExistenceJob *job;
 
   job = g_slice_new0 (AsyncExistenceJob);
 
-  job->base_uris[TEST_SAVED_DIR] = sanitize_save_directory (screenshot_config->save_dir);
+  job->base_uris[TEST_SAVED_DIR] = sanitize_save_directory (save_dir);
   job->base_uris[TEST_DEFAULT] = get_default_screenshot_dir ();
   job->base_uris[TEST_FALLBACK] = get_fallback_screenshot_dir ();
   job->iteration = 0;
diff --git a/src/screenshot-filename-builder.h b/src/screenshot-filename-builder.h
index e26e7bd..9d0c96f 100644
--- a/src/screenshot-filename-builder.h
+++ b/src/screenshot-filename-builder.h
@@ -23,7 +23,8 @@
 
 #include <gio/gio.h>
 
-void screenshot_build_filename_async (GAsyncReadyCallback callback,
+void screenshot_build_filename_async (const char *save_dir,
+                                      GAsyncReadyCallback callback,
                                       gpointer user_data);
 gchar *screenshot_build_filename_finish (GAsyncResult *result,
                                          GError **error);



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