aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorClaudio Saavedra <csaavedra@igalia.com>2012-09-03 19:54:50 +0800
committerClaudio Saavedra <csaavedra@igalia.com>2012-09-03 20:18:25 +0800
commit97d0929cf1691bc029db792e941870948a5e13e5 (patch)
tree4393c42603aefad9ca9a15e42fe3a2f5b96bfe05
parent51a379f461d8bd435054caafe265f102fb05399e (diff)
downloadgsoc2013-epiphany-97d0929cf1691bc029db792e941870948a5e13e5.tar.gz
gsoc2013-epiphany-97d0929cf1691bc029db792e941870948a5e13e5.tar.zst
gsoc2013-epiphany-97d0929cf1691bc029db792e941870948a5e13e5.zip
ephy-file-helpers: rename KEEP_TEMP_DIR to KEEP_DIR
Since this is also used for persistency of temporary directories, but also for --profile.
-rw-r--r--lib/ephy-file-helpers.c6
-rw-r--r--lib/ephy-file-helpers.h2
-rw-r--r--src/ephy-main.c2
-rw-r--r--tests/ephy-file-helpers-test.c18
4 files changed, 14 insertions, 14 deletions
diff --git a/lib/ephy-file-helpers.c b/lib/ephy-file-helpers.c
index 9e9105d2a..4bbe0c974 100644
--- a/lib/ephy-file-helpers.c
+++ b/lib/ephy-file-helpers.c
@@ -58,7 +58,7 @@
static GHashTable *files = NULL;
static GHashTable *mime_table = NULL;
-static gboolean keep_temp_directory = FALSE; /* for debug purposes */
+static gboolean keep_directory = FALSE;
static char *dot_dir = NULL;
static char *tmp_dir = NULL;
static GList *del_on_exit = NULL;
@@ -312,7 +312,7 @@ ephy_file_helpers_init (const char *profile_dir,
(GDestroyNotify) g_free,
(GDestroyNotify) g_free);
- keep_temp_directory = flags & EPHY_FILE_HELPERS_KEEP_TEMP_DIR;
+ keep_directory = flags & EPHY_FILE_HELPERS_KEEP_DIR;
private_profile = flags & EPHY_FILE_HELPERS_PRIVATE_PROFILE;
if (private_profile && profile_dir != NULL)
@@ -385,7 +385,7 @@ ephy_file_helpers_shutdown (void)
if (tmp_dir != NULL)
{
- if (!keep_temp_directory)
+ if (!keep_directory)
{
GFile *tmp_dir_file;
tmp_dir_file = g_file_new_for_path (tmp_dir);
diff --git a/lib/ephy-file-helpers.h b/lib/ephy-file-helpers.h
index 4b7b8e21d..bf52f75b6 100644
--- a/lib/ephy-file-helpers.h
+++ b/lib/ephy-file-helpers.h
@@ -45,7 +45,7 @@ typedef enum
typedef enum
{
EPHY_FILE_HELPERS_NONE = 0,
- EPHY_FILE_HELPERS_KEEP_TEMP_DIR = 1 << 1,
+ EPHY_FILE_HELPERS_KEEP_DIR = 1 << 1,
EPHY_FILE_HELPERS_PRIVATE_PROFILE = 1 << 2,
EPHY_FILE_HELPERS_ENSURE_EXISTS = 1 << 3,
} EphyFileHelpersFlags;
diff --git a/src/ephy-main.c b/src/ephy-main.c
index 063c2f8fa..60a0e616f 100644
--- a/src/ephy-main.c
+++ b/src/ephy-main.c
@@ -404,7 +404,7 @@ main (int argc,
if (private_instance || application_mode)
flags |= EPHY_FILE_HELPERS_PRIVATE_PROFILE;
if (keep_temp_directory || profile_directory)
- flags |= EPHY_FILE_HELPERS_KEEP_TEMP_DIR;
+ flags |= EPHY_FILE_HELPERS_KEEP_DIR;
if (!ephy_file_helpers_init (profile_directory, flags,
&error)) {
diff --git a/tests/ephy-file-helpers-test.c b/tests/ephy-file-helpers-test.c
index 1fa81ad23..fcc869f8f 100644
--- a/tests/ephy-file-helpers-test.c
+++ b/tests/ephy-file-helpers-test.c
@@ -38,7 +38,7 @@ typedef struct {
static const FileInitTest private_tests[] =
{
{ "private", EPHY_FILE_HELPERS_PRIVATE_PROFILE },
- { "private, keep-dir", EPHY_FILE_HELPERS_PRIVATE_PROFILE | EPHY_FILE_HELPERS_KEEP_TEMP_DIR }
+ { "private, keep-dir", EPHY_FILE_HELPERS_PRIVATE_PROFILE | EPHY_FILE_HELPERS_KEEP_DIR }
};
static void
@@ -53,19 +53,19 @@ test_ephy_file_helpers_init ()
char *dot_dir = NULL;
gboolean private_profile = FALSE;
- gboolean keep_tmp = FALSE;
+ gboolean keep_dir = FALSE;
gboolean ensure_exists = FALSE;
test = private_tests[i];
if (test.flags & EPHY_FILE_HELPERS_PRIVATE_PROFILE) private_profile = TRUE;
- if (test.flags & EPHY_FILE_HELPERS_KEEP_TEMP_DIR) keep_tmp = TRUE;
+ if (test.flags & EPHY_FILE_HELPERS_KEEP_DIR) keep_dir = TRUE;
if (test.flags & EPHY_FILE_HELPERS_ENSURE_EXISTS) ensure_exists = TRUE;
- g_test_message ("INIT: dir: %s; private: %s; keep_tmp: %s; ensure_exists: %s",
+ g_test_message ("INIT: dir: %s; private: %s; keep_dir: %s; ensure_exists: %s",
test.dir,
private_profile ? "TRUE" : "FALSE",
- keep_tmp ? "TRUE" : "FALSE",
+ keep_dir ? "TRUE" : "FALSE",
ensure_exists ? "TRUE" : "FALSE");
g_assert (ephy_dot_dir () == NULL);
@@ -84,11 +84,11 @@ test_ephy_file_helpers_init ()
ephy_file_helpers_shutdown ();
/* Private profiles have their dot_dir inside tmp_dir. */
- g_assert (g_file_test (tmp_dir, G_FILE_TEST_EXISTS) == keep_tmp);
- g_assert (g_file_test (dot_dir, G_FILE_TEST_EXISTS) == (keep_tmp && ensure_exists));
+ g_assert (g_file_test (tmp_dir, G_FILE_TEST_EXISTS) == keep_dir);
+ g_assert (g_file_test (dot_dir, G_FILE_TEST_EXISTS) == (keep_dir && ensure_exists));
- /* Cleanup tmp-dir left behind. */
- if (keep_tmp) {
+ /* Cleanup dir left behind. */
+ if (keep_dir) {
GFile *file;
file = g_file_new_for_path (tmp_dir);