aboutsummaryrefslogtreecommitdiffstats
path: root/lib/ephy-file-helpers.c
diff options
context:
space:
mode:
authorXan Lopez <xan@igalia.com>2012-05-08 02:27:33 +0800
committerXan Lopez <xan@igalia.com>2012-05-08 02:29:24 +0800
commit3847db0803addac9f0b90dc86767d8f65768d4ad (patch)
treebaa17c614dc6b90333eeca6ab47f2629c9303546 /lib/ephy-file-helpers.c
parent8c65eb746306499465f23057dbd4dea484c953aa (diff)
downloadgsoc2013-epiphany-3847db0803addac9f0b90dc86767d8f65768d4ad.tar
gsoc2013-epiphany-3847db0803addac9f0b90dc86767d8f65768d4ad.tar.gz
gsoc2013-epiphany-3847db0803addac9f0b90dc86767d8f65768d4ad.tar.bz2
gsoc2013-epiphany-3847db0803addac9f0b90dc86767d8f65768d4ad.tar.lz
gsoc2013-epiphany-3847db0803addac9f0b90dc86767d8f65768d4ad.tar.xz
gsoc2013-epiphany-3847db0803addac9f0b90dc86767d8f65768d4ad.tar.zst
gsoc2013-epiphany-3847db0803addac9f0b90dc86767d8f65768d4ad.zip
Allow for more fine-grained file helpers init
Since we are about to migrate our profile dir, allow file helpers init to not ensure the profile dir exists (it was hardcoded until now). For this we get rid of the ugly boolean parameters and add a flags parameter, which preserves the old behaviors and allows for this new option. We update all the callers in the tree.
Diffstat (limited to 'lib/ephy-file-helpers.c')
-rw-r--r--lib/ephy-file-helpers.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/lib/ephy-file-helpers.c b/lib/ephy-file-helpers.c
index 50e81f315..63f3c1434 100644
--- a/lib/ephy-file-helpers.c
+++ b/lib/ephy-file-helpers.c
@@ -272,8 +272,7 @@ ephy_dot_dir (void)
/**
* ephy_file_helpers_init:
* @profile_dir: directory to use as Epiphany's profile
- * @private_profile: %TRUE if we should use a private profile
- * @keep_temp_dir: %TRUE to omit deleting the temp dir on exit
+ * @flags: the %EphyFileHelpersFlags for this session
* @error: an optional #GError
*
* Initializes Epiphany file helper functions, sets @profile_dir as Epiphany's
@@ -283,11 +282,11 @@ ephy_dot_dir (void)
**/
gboolean
ephy_file_helpers_init (const char *profile_dir,
- gboolean private_profile,
- gboolean keep_temp_dir,
+ EphyFileHelpersFlags flags,
GError **error)
{
const char *uuid;
+ gboolean private_profile;
/* See if we've been calling ourself, and abort if we have */
uuid = g_getenv (EPHY_UUID_ENVVAR);
@@ -307,7 +306,8 @@ ephy_file_helpers_init (const char *profile_dir,
(GDestroyNotify) g_free,
(GDestroyNotify) g_free);
- keep_temp_directory = keep_temp_dir;
+ keep_temp_directory = flags & EPHY_FILE_HELPERS_KEEP_TEMP_DIR;
+ private_profile = flags & EPHY_FILE_HELPERS_PRIVATE_PROFILE;
if (private_profile && profile_dir != NULL)
{
@@ -336,8 +336,11 @@ ephy_file_helpers_init (const char *profile_dir,
"epiphany",
NULL);
}
-
- return ephy_ensure_dir_exists (ephy_dot_dir (), error);
+
+ if (flags & EPHY_FILE_HELPERS_ENSURE_EXISTS)
+ return ephy_ensure_dir_exists (ephy_dot_dir (), error);
+ else
+ return TRUE;
}
static void