[tracker] libtracker-data: Support restore with test schema
- From: Jürg Billeter <juergbi src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [tracker] libtracker-data: Support restore with test schema
- Date: Mon, 15 Mar 2010 17:02:32 +0000 (UTC)
commit 1f1e94397f796eef0a2c65a9730270e3cd8b01fd
Author: Jürg Billeter <j bitron ch>
Date: Mon Mar 15 18:01:53 2010 +0100
libtracker-data: Support restore with test schema
src/libtracker-data/tracker-data-backup.c | 5 +++--
src/libtracker-data/tracker-data-backup.h | 3 ++-
src/tracker-store/tracker-backup.c | 3 ++-
tests/libtracker-data/tracker-backup-test.c | 7 ++++---
4 files changed, 11 insertions(+), 7 deletions(-)
---
diff --git a/src/libtracker-data/tracker-data-backup.c b/src/libtracker-data/tracker-data-backup.c
index eecfe49..0c89a26 100644
--- a/src/libtracker-data/tracker-data-backup.c
+++ b/src/libtracker-data/tracker-data-backup.c
@@ -126,7 +126,8 @@ void
tracker_data_backup_restore (GFile *journal,
TrackerDataBackupFinished callback,
gpointer user_data,
- GDestroyNotify destroy)
+ GDestroyNotify destroy,
+ const gchar *test_schema)
{
BackupSaveInfo *info;
@@ -163,7 +164,7 @@ tracker_data_backup_restore (GFile *journal,
tracker_db_journal_shutdown ();
- tracker_data_manager_init (flags, NULL, &is_first, TRUE);
+ tracker_data_manager_init (flags, test_schema, &is_first, TRUE);
} else {
g_set_error (&info->error, TRACKER_DATA_BACKUP_ERROR, 0,
diff --git a/src/libtracker-data/tracker-data-backup.h b/src/libtracker-data/tracker-data-backup.h
index 8dc4acf..b679192 100644
--- a/src/libtracker-data/tracker-data-backup.h
+++ b/src/libtracker-data/tracker-data-backup.h
@@ -43,7 +43,8 @@ void tracker_data_backup_save (GFile *destination,
void tracker_data_backup_restore (GFile *journal,
TrackerDataBackupFinished callback,
gpointer user_data,
- GDestroyNotify destroy);
+ GDestroyNotify destroy,
+ const gchar *test_schema);
G_END_DECLS
diff --git a/src/tracker-store/tracker-backup.c b/src/tracker-store/tracker-backup.c
index b931317..c64e14e 100644
--- a/src/tracker-store/tracker-backup.c
+++ b/src/tracker-store/tracker-backup.c
@@ -130,7 +130,8 @@ tracker_backup_restore (TrackerBackup *object,
tracker_data_backup_restore (journal,
backup_callback,
info,
- (GDestroyNotify) g_free);
+ (GDestroyNotify) g_free,
+ NULL);
g_object_unref (journal);
}
diff --git a/tests/libtracker-data/tracker-backup-test.c b/tests/libtracker-data/tracker-backup-test.c
index 4425f9f..582b586 100644
--- a/tests/libtracker-data/tracker-backup-test.c
+++ b/tests/libtracker-data/tracker-backup-test.c
@@ -95,7 +95,7 @@ test_backup_and_restore (void)
*/
tracker_data_manager_init (TRACKER_DB_MANAGER_FORCE_REINDEX,
data_prefix,
- NULL);
+ NULL, FALSE);
/* load data set */
data_filename = g_strconcat (data_prefix, ".data", NULL);
@@ -109,6 +109,7 @@ test_backup_and_restore (void)
}
g_free (data_filename);
+
/* Check everything is correct */
check_content_in_db (3, 1);
@@ -137,10 +138,10 @@ test_backup_and_restore (void)
tracker_data_manager_init (TRACKER_DB_MANAGER_FORCE_REINDEX,
data_prefix,
- NULL);
+ NULL, FALSE);
check_content_in_db (0, 0);
- tracker_data_backup_restore (backup_file, backup_finished_cb, NULL, NULL);
+ tracker_data_backup_restore (backup_file, backup_finished_cb, NULL, NULL, data_prefix);
check_content_in_db (3, 1);
g_assert_cmpint (backup_calls, ==, 2);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]