[epiphany] ephy-profile-utils: add a profile_dir parameter to ephy_profile_utils_do_migration()



commit 95eb18e603accc3dd23c32c9dfbdf79b1723d391
Author: Claudio Saavedra <csaavedra igalia com>
Date:   Mon Sep 3 17:41:25 2012 +0300

    ephy-profile-utils: add a profile_dir parameter to ephy_profile_utils_do_migration()
    
    This is passed further on to the migrator process. Right now this is
    unused.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=681679

 lib/ephy-profile-utils.c    |    7 ++++++-
 lib/ephy-profile-utils.h    |    2 +-
 src/ephy-main.c             |    2 +-
 tests/ephy-migration-test.c |    4 ++--
 4 files changed, 10 insertions(+), 5 deletions(-)
---
diff --git a/lib/ephy-profile-utils.c b/lib/ephy-profile-utils.c
index 58abfff..51dd7e1 100644
--- a/lib/ephy-profile-utils.c
+++ b/lib/ephy-profile-utils.c
@@ -200,7 +200,7 @@ _ephy_profile_utils_query_form_auth_data (const char *uri,
 #define EPHY_PROFILE_MIGRATOR "ephy-profile-migrator"
 
 gboolean
-ephy_profile_utils_do_migration (int test_to_run, gboolean debug)
+ephy_profile_utils_do_migration (const char *profile_directory, int test_to_run, gboolean debug)
 {
   gboolean ret;
   GError *error = NULL;
@@ -219,6 +219,11 @@ ephy_profile_utils_do_migration (int test_to_run, gboolean debug)
     argv[i++] = index;
   }
 
+  if (profile_directory != NULL) {
+    argv[i++] = "-p";
+    argv[i++] = (char *)profile_directory;
+  }
+
   argv[i++] = NULL;
 
   if (debug)
diff --git a/lib/ephy-profile-utils.h b/lib/ephy-profile-utils.h
index 8f50922..5a9b844 100644
--- a/lib/ephy-profile-utils.h
+++ b/lib/ephy-profile-utils.h
@@ -32,7 +32,7 @@ int ephy_profile_utils_get_migration_version (void);
 
 gboolean ephy_profile_utils_set_migration_version (int version);
 
-gboolean ephy_profile_utils_do_migration (int test_to_run, gboolean debug);
+gboolean ephy_profile_utils_do_migration (const char *profile_directory, int test_to_run, gboolean debug);
 
 void _ephy_profile_utils_store_form_auth_data (const char *uri,
                                                const char *form_username,
diff --git a/src/ephy-main.c b/src/ephy-main.c
index 60a0e61..4ea621a 100644
--- a/src/ephy-main.c
+++ b/src/ephy-main.c
@@ -392,7 +392,7 @@ main (int argc,
   /* TODO: we want to migrate each WebApp profile too. */
   if (!private_instance && !application_mode) {
     /* If the migration fails we don't really want to continue. */
-    if (!ephy_profile_utils_do_migration (-1, FALSE)) {
+    if (!ephy_profile_utils_do_migration ((const char *)profile_directory, -1, FALSE)) {
       g_print ("Failed to run the migrator process, Web will now abort.");
       exit (1);
     }
diff --git a/tests/ephy-migration-test.c b/tests/ephy-migration-test.c
index 3051f2d..983e8ce 100644
--- a/tests/ephy-migration-test.c
+++ b/tests/ephy-migration-test.c
@@ -36,7 +36,7 @@ test_do_migration_simple (void)
 {
     gboolean ret;
 
-    ret = ephy_profile_utils_do_migration (-1, TRUE);
+    ret = ephy_profile_utils_do_migration (NULL, -1, TRUE);
     g_assert (ret);
 }
 
@@ -45,7 +45,7 @@ test_do_migration_invalid (void)
 {
     gboolean ret;
 
-    ret = ephy_profile_utils_do_migration (EPHY_PROFILE_MIGRATION_VERSION + 1, TRUE);
+    ret = ephy_profile_utils_do_migration (NULL, EPHY_PROFILE_MIGRATION_VERSION + 1, TRUE);
     g_assert (ret == FALSE);
 }
 



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