From 3847db0803addac9f0b90dc86767d8f65768d4ad Mon Sep 17 00:00:00 2001 From: Xan Lopez Date: Mon, 7 May 2012 20:27:33 +0200 Subject: 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. --- src/ephy-main.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'src/ephy-main.c') diff --git a/src/ephy-main.c b/src/ephy-main.c index a9b71dd89..328e506ce 100644 --- a/src/ephy-main.c +++ b/src/ephy-main.c @@ -26,6 +26,7 @@ #include "ephy-embed-prefs.h" #include "ephy-file-helpers.h" #include "ephy-private.h" +#include "ephy-profile-utils.h" #include "ephy-session.h" #include "ephy-settings.h" #include "ephy-shell.h" @@ -245,6 +246,7 @@ main (int argc, EphyStartupFlags startup_flags; EphyEmbedShellMode mode; int status; + EphyFileHelpersFlags flags; #ifdef ENABLE_NLS /* Initialize the i18n stuff */ @@ -392,9 +394,14 @@ main (int argc, ephy_profile_utils_do_migration (); /* Start our services */ - if (!ephy_file_helpers_init (profile_directory, - private_instance || application_mode, - keep_temp_directory || profile_directory, + flags = EPHY_FILE_HELPERS_ENSURE_EXISTS; + + if (private_instance || application_mode) + flags |= EPHY_FILE_HELPERS_PRIVATE_PROFILE; + if (keep_temp_directory || profile_directory) + flags |= EPHY_FILE_HELPERS_KEEP_TEMP_DIR; + + if (!ephy_file_helpers_init (profile_directory, flags, &error)) { show_error_message (&error); exit (1); -- cgit v1.2.3