summaryrefslogtreecommitdiff
path: root/src/screenshot-filename-builder.c
diff options
context:
space:
mode:
authorCosimo Cecchi <cosimoc@gnome.org>2012-01-26 10:14:31 -0500
committerCosimo Cecchi <cosimoc@gnome.org>2012-01-26 16:37:28 -0500
commite2aae6f29c1aaf6c0285f853628d2a5142465baa (patch)
treebf0a0f7d466817f0d80faa366b7172b3c5f44729 /src/screenshot-filename-builder.c
parent6c4561ba0aa407126cbc4da594c5983d7b3140f5 (diff)
downloadgnome-screenshot-e2aae6f29c1aaf6c0285f853628d2a5142465baa.tar.gz
screenshot: fetch the picture saved dir from the filename builder
Instead of passing it through; simplifies code.
Diffstat (limited to 'src/screenshot-filename-builder.c')
-rw-r--r--src/screenshot-filename-builder.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/src/screenshot-filename-builder.c b/src/screenshot-filename-builder.c
index 5a5d4b8..1154c21 100644
--- a/src/screenshot-filename-builder.c
+++ b/src/screenshot-filename-builder.c
@@ -24,15 +24,18 @@
#include <pwd.h>
#include <string.h>
+#include "screenshot-config.h"
+
typedef enum
{
- TEST_LAST_DIR = 0,
- TEST_DEFAULT = 1
+ TEST_SAVED_DIR = 0,
+ TEST_DEFAULT,
+ NUM_TESTS
} TestType;
typedef struct
{
- char *base_uris[3];
+ char *base_uris[NUM_TESTS];
int iteration;
TestType type;
@@ -138,7 +141,7 @@ async_existence_job_free (AsyncExistenceJob *job)
{
gint idx;
- for (idx = 0; idx < 3; idx++)
+ for (idx = 0; idx < NUM_TESTS; idx++)
g_free (job->base_uris[idx]);
g_clear_object (&job->async_result);
@@ -255,18 +258,17 @@ out:
}
void
-screenshot_build_filename_async (const gchar *save_dir,
- GAsyncReadyCallback callback,
+screenshot_build_filename_async (GAsyncReadyCallback callback,
gpointer user_data)
{
AsyncExistenceJob *job;
job = g_slice_new0 (AsyncExistenceJob);
- job->base_uris[0] = sanitize_save_directory (save_dir);
+ job->base_uris[0] = sanitize_save_directory (screenshot_config->last_save_dir);
job->base_uris[1] = get_default_screenshot_dir ();
job->iteration = 0;
- job->type = TEST_LAST_DIR;
+ job->type = TEST_SAVED_DIR;
job->async_result = g_simple_async_result_new (NULL,
callback, user_data,