[epiphany] profile-migrator: Don't migrate bookmarks if gvdb file exists



commit 54006df8dba31a5a58686e7d2473d64f3e454683
Author: Michael Catanzaro <mcatanzaro gnome org>
Date:   Sun Oct 9 18:13:05 2016 -0500

    profile-migrator: Don't migrate bookmarks if gvdb file exists
    
    This makes the profile migrator robust to being run several times, e.g.
    when I switch back and forth between system and JHBuild copies of
    Epiphany.
    
    I wound up with two copies of all of my bookmarks!

 lib/ephy-profile-utils.h                     |    2 --
 src/profile-migrator/ephy-profile-migrator.c |   10 +++++++++-
 2 files changed, 9 insertions(+), 3 deletions(-)
---
diff --git a/lib/ephy-profile-utils.h b/lib/ephy-profile-utils.h
index 254256f..08bf264 100644
--- a/lib/ephy-profile-utils.h
+++ b/lib/ephy-profile-utils.h
@@ -27,8 +27,6 @@ G_BEGIN_DECLS
 #define EPHY_PROFILE_MIGRATION_VERSION 11
 
 #define EPHY_HISTORY_FILE       "ephy-history.db"
-#define EPHY_BOOKMARKS_FILE     "ephy-bookmarks.xml"
-#define EPHY_BOOKMARKS_FILE_RDF "bookmarks.rdf"
 
 int ephy_profile_utils_get_migration_version (void);
 
diff --git a/src/profile-migrator/ephy-profile-migrator.c b/src/profile-migrator/ephy-profile-migrator.c
index b70177d..8156bfc 100644
--- a/src/profile-migrator/ephy-profile-migrator.c
+++ b/src/profile-migrator/ephy-profile-migrator.c
@@ -570,7 +570,15 @@ migrate_bookmarks (void)
   xmlNodePtr root;
 
   filename = g_build_filename (ephy_dot_dir (),
-                               EPHY_BOOKMARKS_FILE_RDF,
+                               "bookmarks.gvdb",
+                               NULL);
+
+  if (g_file_test (filename, G_FILE_TEST_EXISTS) == TRUE)
+    goto out;
+
+  g_free (filename);
+  filename = g_build_filename (ephy_dot_dir (),
+                               "bookmarks.rdf",
                                NULL);
 
   if (g_file_test (filename, G_FILE_TEST_EXISTS) == FALSE)


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