[epiphany/mcatanzaro/web-apps-again-again-again: 1/9] profile-migrator: fix profile dir migration for web app mode



commit 8f3e012a4fdb5834c12bca1027207e6411c64aa8
Author: Michael Catanzaro <mcatanzaro igalia com>
Date:   Fri May 24 13:47:00 2019 -0500

    profile-migrator: fix profile dir migration for web app mode
    
    If we launch a web app before launching the main browser instance, we
    try to migrate relative to the wrong directory. Oops.
    
    We'll need to rerun the migration to fix this for users who already have
    broken migrations.

 lib/ephy-profile-utils.h                     | 2 +-
 src/profile-migrator/ephy-profile-migrator.c | 7 ++++---
 2 files changed, 5 insertions(+), 4 deletions(-)
---
diff --git a/lib/ephy-profile-utils.h b/lib/ephy-profile-utils.h
index f64f324f5..07926d226 100644
--- a/lib/ephy-profile-utils.h
+++ b/lib/ephy-profile-utils.h
@@ -24,7 +24,7 @@
 
 G_BEGIN_DECLS
 
-#define EPHY_PROFILE_MIGRATION_VERSION 32
+#define EPHY_PROFILE_MIGRATION_VERSION 33
 #define EPHY_INSECURE_PASSWORDS_MIGRATION_VERSION 11
 #define EPHY_FIREFOX_SYNC_PASSWORDS_MIGRATION_VERSION 19
 #define EPHY_TARGET_ORIGIN_MIGRATION_VERSION 21
diff --git a/src/profile-migrator/ephy-profile-migrator.c b/src/profile-migrator/ephy-profile-migrator.c
index 5ba3fe24e..f26ef1053 100644
--- a/src/profile-migrator/ephy-profile-migrator.c
+++ b/src/profile-migrator/ephy-profile-migrator.c
@@ -1146,7 +1146,7 @@ migrate_profile_directories (void)
     g_autoptr(GError) error = NULL;
 
     g_autofree char *old_name = g_strconcat ("app-epiphany-", app->id, NULL);
-    g_autofree char *old_path = g_build_filename (legacy_profile_dir (), old_name, NULL);
+    g_autofree char *old_path = g_build_filename (legacy_default_profile_dir (), old_name, NULL);
     g_autofree char *app_path = ephy_web_application_get_profile_directory (app->id);
 
     if (!move_directory_contents (old_path, app_path))
@@ -1161,7 +1161,7 @@ migrate_profile_directories (void)
       close (fd);
 
     // Update Exec and Icon to point to the new profile dir
-    g_autofree char *old_profile_prefix = g_build_filename (legacy_profile_dir (), "app-epiphany-", NULL);
+    g_autofree char *old_profile_prefix = g_build_filename (legacy_default_profile_dir (), "app-epiphany-", 
NULL);
     g_autofree char *new_profile_prefix = g_build_filename (g_get_user_data_dir (), "epiphany-", NULL);
     g_autoptr(GKeyFile) file = g_key_file_new ();
     g_autofree char *desktop_file_path = g_build_filename (app_path, app->desktop_file, NULL);
@@ -1363,9 +1363,10 @@ const EphyProfileMigrator migrators[] = {
   /* 27 */ migrate_nothing,
   /* 28 */ migrate_annoyance_list,
   /* 29 */ migrate_zoom_level,
-  /* 30 */ migrate_profile_directories,
+  /* 30 */ migrate_nothing,
   /* 31 */ migrate_web_extension_config_dir,
   /* 32 */ migrate_webapps_harder,
+  /* 33 */ migrate_profile_directories,
 };
 
 static gboolean


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]