aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorXan Lopez <xan@igalia.com>2012-08-29 22:16:51 +0800
committerXan Lopez <xan@igalia.com>2012-08-29 22:16:51 +0800
commitdb0ec5890ede6b6eefced0b181b3996077d76f3c (patch)
tree61529ca3780c702191b31f956613e074434274ff
parentaf52bd9179d34a6273e8279fb23ed50eea9c42b8 (diff)
downloadgsoc2013-epiphany-db0ec5890ede6b6eefced0b181b3996077d76f3c.tar.gz
gsoc2013-epiphany-db0ec5890ede6b6eefced0b181b3996077d76f3c.tar.zst
gsoc2013-epiphany-db0ec5890ede6b6eefced0b181b3996077d76f3c.zip
ephy-profile-migrator: do nothing if there's no profile dir
If there's no profile dir there should not be anything to do for the profile migrator (since in theory epiphany has never been executed). This might backfire for people that manually mess with their profile dir (removing it), but those people hopefully know what they are doing.
-rw-r--r--lib/ephy-profile-migrator.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/ephy-profile-migrator.c b/lib/ephy-profile-migrator.c
index 4919896e3..f013473c0 100644
--- a/lib/ephy-profile-migrator.c
+++ b/lib/ephy-profile-migrator.c
@@ -60,6 +60,12 @@ static int do_step_n = -1;
typedef void (*EphyProfileMigrator) (void);
+static gboolean
+profile_dir_exists ()
+{
+ return g_file_test (ephy_dot_dir (), G_FILE_TEST_EXISTS | G_FILE_TEST_IS_DIR);
+}
+
static void
migrate_cookies ()
{
@@ -787,6 +793,12 @@ ephy_migrator ()
* very beginning. */
migrate_profile_gnome2_to_xdg ();
+ /* If after this point there's no profile dir, there's no point in
+ * running anything because Epiphany has never run in this sytem, so
+ * exit here. */
+ if (!profile_dir_exists ())
+ return TRUE;
+
if (do_step_n != -1) {
if (do_step_n >= EPHY_PROFILE_MIGRATION_VERSION)
return FALSE;