diff options
author | Xan Lopez <xan@igalia.com> | 2012-08-29 22:16:12 +0800 |
---|---|---|
committer | Xan Lopez <xan@igalia.com> | 2012-08-29 22:16:12 +0800 |
commit | af52bd9179d34a6273e8279fb23ed50eea9c42b8 (patch) | |
tree | 38a0188b4ca22bf3a57cea39dda6a5ba35de7888 /lib | |
parent | fc20573cd201f12bf13316be050736a9e4a098be (diff) | |
download | gsoc2013-epiphany-af52bd9179d34a6273e8279fb23ed50eea9c42b8.tar.gz gsoc2013-epiphany-af52bd9179d34a6273e8279fb23ed50eea9c42b8.tar.zst gsoc2013-epiphany-af52bd9179d34a6273e8279fb23ed50eea9c42b8.zip |
ephy-file-helpers: add '.migrated' file to newly created profile dirs
Otherwise we'll try to migrate old data in new ephy installs, which
does not make sense.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/ephy-file-helpers.c | 29 |
1 files changed, 21 insertions, 8 deletions
diff --git a/lib/ephy-file-helpers.c b/lib/ephy-file-helpers.c index 4975811f8..9ccdf017b 100644 --- a/lib/ephy-file-helpers.c +++ b/lib/ephy-file-helpers.c @@ -26,6 +26,7 @@ #include "ephy-prefs.h" #include "ephy-debug.h" +#include "ephy-profile-utils.h" #include "ephy-settings.h" #include "ephy-string.h" @@ -429,18 +430,30 @@ ephy_ensure_dir_exists (const char *dir, 0, _("The file “%s” exists. Please move it out of the way."), dir); + return FALSE; } - if (!g_file_test (dir, G_FILE_TEST_EXISTS) && - g_mkdir_with_parents (dir, 488) != 0) + if (!g_file_test (dir, G_FILE_TEST_EXISTS)) { - g_set_error (error, - EPHY_FILE_HELPERS_ERROR_QUARK, - 0, - _("Failed to create directory “%s”."), - dir); - return FALSE; + if (g_mkdir_with_parents (dir, 488) == 0) + { + /* We need to set the .migrated file to the + * current profile migration version, + * otherwise the next time the browser runs + * things might go awry. */ + ephy_profile_utils_set_migration_version (EPHY_PROFILE_MIGRATION_VERSION); + } + else + { + g_set_error (error, + EPHY_FILE_HELPERS_ERROR_QUARK, + 0, + _("Failed to create directory “%s”."), + dir); + + return FALSE; + } } return TRUE; |