[epiphany] ephy-profile-migration.c: repeat password migration when needed



commit 5e8dbdfc44572177fec1801e0e4c5380df5b0e6e
Author: Xan Lopez <xan gnome org>
Date:   Mon Sep 14 10:43:39 2009 +0300

    ephy-profile-migration.c: repeat password migration when needed
    
    The previous version had some bugs in it, so run it again for users
    that had already migrated their profile.

 src/ephy-profile-migration.c |   16 ++++++++++++++--
 1 files changed, 14 insertions(+), 2 deletions(-)
---
diff --git a/src/ephy-profile-migration.c b/src/ephy-profile-migration.c
index 8308915..c0c319d 100644
--- a/src/ephy-profile-migration.c
+++ b/src/ephy-profile-migration.c
@@ -47,7 +47,7 @@
  *  - Add your function at the end of the 'migrators' array
  */
 
-#define PROFILE_MIGRATION_VERSION 2
+#define PROFILE_MIGRATION_VERSION 3
 
 typedef void (*EphyProfileMigrator) (void);
 
@@ -352,6 +352,9 @@ migrate_passwords ()
 
 const EphyProfileMigrator migrators[] = {
   migrate_cookies,
+  migrate_passwords,
+ /* Yes, again! Version 2 had some bugs, so we need to run
+    migrate_passwords again to possibly migrate more passwords*/
   migrate_passwords
 };
 
@@ -385,7 +388,16 @@ _ephy_profile_migrate ()
     latest = 0;
   
   for (i = latest; i < PROFILE_MIGRATION_VERSION; i++) {
-    EphyProfileMigrator m = migrators[i];
+    EphyProfileMigrator m;
+
+    /* No need to run the password migration twice in a row. It
+       appears twice in the list for the benefit of people that were
+       using the development snapshots, since an early version didn't
+       migrate all passwords correctly. */
+    if (i == 1)
+      continue;
+
+    m = migrators[i];
     m();
   }
 



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