[tracker] tracker-store: Status notifications during backup restore and journal replay



commit afd12a6105e98a10f81406a216d4be6983f6a60d
Author: Philip Van Hoof <philip codeminded be>
Date:   Fri Mar 26 14:51:59 2010 +0100

    tracker-store: Status notifications during backup restore and journal replay

 data/dbus/Makefile.am                             |    3 +-
 data/dbus/tracker-busy-notifier.xml               |   23 +++
 src/libtracker-data/tracker-data-backup.c         |    2 +-
 src/libtracker-data/tracker-data-manager.c        |    5 +-
 src/libtracker-data/tracker-data-manager.h        |    3 +-
 src/libtracker-data/tracker-data-update.c         |   14 +-
 src/libtracker-data/tracker-data-update.h         |    6 +-
 src/tracker-store/Makefile.am                     |    7 +-
 src/tracker-store/tracker-busy-notifier.c         |  205 +++++++++++++++++++++
 src/tracker-store/tracker-busy-notifier.h         |   74 ++++++++
 src/tracker-store/tracker-dbus.c                  |   29 +++
 src/tracker-store/tracker-dbus.h                  |   11 +-
 src/tracker-store/tracker-main.c                  |   16 ++-
 src/tracker-store/tracker-marshal.list            |    1 +
 tests/libtracker-data/tracker-backup-test.c       |    4 +-
 tests/libtracker-data/tracker-ontology-test.c     |    7 +-
 tests/libtracker-data/tracker-sparql-blank-test.c |    1 +
 tests/libtracker-data/tracker-sparql-test.c       |    2 +-
 tests/libtracker-fts/tracker-fts-test.c           |    2 +-
 19 files changed, 388 insertions(+), 27 deletions(-)
---
diff --git a/data/dbus/Makefile.am b/data/dbus/Makefile.am
index 0aab644..13acf5c 100644
--- a/data/dbus/Makefile.am
+++ b/data/dbus/Makefile.am
@@ -10,7 +10,8 @@ config_DATA =							\
 	tracker-resources.xml					\
 	tracker-resources-class.xml				\
 	tracker-statistics.xml					\
-	tracker-writeback.xml
+	tracker-writeback.xml					\
+	tracker-busy-notifier.xml
 
 config_noinst = 						\
 	tracker-miner-files-reindex.xml
diff --git a/data/dbus/tracker-busy-notifier.xml b/data/dbus/tracker-busy-notifier.xml
new file mode 100644
index 0000000..f50056b
--- /dev/null
+++ b/data/dbus/tracker-busy-notifier.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<node name="/">
+  <interface name="org.freedesktop.Tracker1.BusyNotifier">
+
+   <method name="GetStatus">
+      <annotation name="org.freedesktop.DBus.GLib.Async" value="true"/>
+      <arg type="s" name="status" direction="out" />
+    </method>
+    <method name="GetProgress">
+      <annotation name="org.freedesktop.DBus.GLib.Async" value="true"/>
+      <arg type="d" name="progress" direction="out" />
+    </method>
+
+    <!-- Signals -->
+    <signal name="Progress">
+      <arg type="s" name="status" />
+      <arg type="d" name="progress" />
+    </signal>
+
+
+  </interface>
+</node>
diff --git a/src/libtracker-data/tracker-data-backup.c b/src/libtracker-data/tracker-data-backup.c
index 311b4bc..9ee3d64 100644
--- a/src/libtracker-data/tracker-data-backup.c
+++ b/src/libtracker-data/tracker-data-backup.c
@@ -165,7 +165,7 @@ tracker_data_backup_restore (GFile *journal,
 		tracker_db_journal_shutdown ();
 
 		tracker_data_manager_init (flags, test_schemas, &is_first, TRUE,
-		                           NULL, NULL);
+		                           NULL, NULL, "Restoring backup");
 
 	} else {
 		g_set_error (&info->error, TRACKER_DATA_BACKUP_ERROR, 0, 
diff --git a/src/libtracker-data/tracker-data-manager.c b/src/libtracker-data/tracker-data-manager.c
index 60847af..850ced0 100644
--- a/src/libtracker-data/tracker-data-manager.c
+++ b/src/libtracker-data/tracker-data-manager.c
@@ -1438,7 +1438,8 @@ tracker_data_manager_init (TrackerDBManagerFlags  flags,
                            gboolean              *first_time,
                            gboolean               journal_check,
                            TrackerBusyCallback    busy_callback,
-                           gpointer               busy_user_data)
+                           gpointer               busy_user_data,
+                           const gchar           *busy_status)
 {
 	TrackerDBInterface *iface;
 	gboolean is_first_time_index, read_journal, check_ontology;
@@ -1519,7 +1520,7 @@ tracker_data_manager_init (TrackerDBManagerFlags  flags,
 		/* Start replay. Ontology changes might happen during replay of the journal. */
 
 		tracker_data_replay_journal (classes, properties, id_uri_map, 
-		                             busy_callback, busy_user_data);
+		                             busy_callback, busy_user_data, busy_status);
 
 		in_journal_replay = FALSE;
 
diff --git a/src/libtracker-data/tracker-data-manager.h b/src/libtracker-data/tracker-data-manager.h
index 134f434..83800c7 100644
--- a/src/libtracker-data/tracker-data-manager.h
+++ b/src/libtracker-data/tracker-data-manager.h
@@ -44,7 +44,8 @@ gboolean tracker_data_manager_init                (TrackerDBManagerFlags  flags,
                                                    gboolean              *first_time,
                                                    gboolean               journal_check,
                                                    TrackerBusyCallback    busy_callback,
-                                                   gpointer               busy_user_data);
+                                                   gpointer               busy_user_data,
+                                                   const gchar           *busy_status);
 void     tracker_data_manager_shutdown            (void);
 gint64   tracker_data_manager_get_db_option_int64 (const gchar           *option);
 void     tracker_data_manager_set_db_option_int64 (const gchar           *option,
diff --git a/src/libtracker-data/tracker-data-update.c b/src/libtracker-data/tracker-data-update.c
index 9a00a18..b0a30b2 100644
--- a/src/libtracker-data/tracker-data-update.c
+++ b/src/libtracker-data/tracker-data-update.c
@@ -2367,7 +2367,8 @@ tracker_data_replay_journal (GHashTable          *classes,
                              GHashTable          *properties,
                              GHashTable          *id_uri_map,
                              TrackerBusyCallback  busy_callback,
-                             gpointer             busy_user_data)
+                             gpointer             busy_user_data,
+                             const gchar         *busy_status)
 {
 	GError *journal_error = NULL;
 	static TrackerProperty *rdf_type = NULL;
@@ -2388,11 +2389,6 @@ tracker_data_replay_journal (GHashTable          *classes,
 		const gchar *object;
 		gint graph_id, subject_id, predicate_id, object_id;
 
-		if (busy_callback) {
-			busy_callback (tracker_db_journal_reader_get_progress (),
-			               busy_user_data);
-		}
-
 		type = tracker_db_journal_reader_get_type ();
 		if (type == TRACKER_DB_JOURNAL_RESOURCE) {
 			GError *new_error = NULL;
@@ -2654,6 +2650,12 @@ tracker_data_replay_journal (GHashTable          *classes,
 				g_warning ("Journal replay error: 'property with ID %d doesn't exist'", predicate_id);
 			}
 		}
+
+		if (busy_callback) {
+			busy_callback (busy_status,
+			               tracker_db_journal_reader_get_progress (),
+			               busy_user_data);
+		}
 	}
 
 	if (journal_error) {
diff --git a/src/libtracker-data/tracker-data-update.h b/src/libtracker-data/tracker-data-update.h
index b82fc4d..3b90382 100644
--- a/src/libtracker-data/tracker-data-update.h
+++ b/src/libtracker-data/tracker-data-update.h
@@ -50,7 +50,8 @@ typedef void (*TrackerStatementCallback) (const gchar *graph,
                                           GPtrArray   *rdf_types,
                                           gpointer     user_data);
 typedef void (*TrackerCommitCallback)    (gpointer     user_data);
-typedef void (*TrackerBusyCallback)      (gdouble      progress,
+typedef void (*TrackerBusyCallback)      (const gchar *status,
+                                          gdouble      progress,
                                           gpointer     user_data);
 
 GQuark   tracker_data_error_quark                   (void);
@@ -98,7 +99,8 @@ void     tracker_data_replay_journal                (GHashTable                *
                                                      GHashTable                *properties,
                                                      GHashTable                *id_uri_map,
                                                      TrackerBusyCallback        busy_callback,
-                                                     gpointer                   busy_user_data);
+                                                     gpointer                   busy_user_data,
+                                                     const gchar               *busy_status);
 
 /* Calling back */
 void     tracker_data_add_insert_statement_callback   (TrackerStatementCallback   callback,
diff --git a/src/tracker-store/Makefile.am b/src/tracker-store/Makefile.am
index 236cae4..b146bec 100644
--- a/src/tracker-store/Makefile.am
+++ b/src/tracker-store/Makefile.am
@@ -49,7 +49,9 @@ tracker_store_SOURCES =							\
 	tracker-statistics.c						\
 	tracker-statistics.h						\
 	tracker-store.c							\
-	tracker-store.h
+	tracker-store.h							\
+	tracker-busy-notifier.c						\
+	tracker-busy-notifier.h
 
 if OS_WIN32
 tracker_store_win_libs = -lws2_32 -lkernel32
@@ -81,7 +83,8 @@ dbus_sources = 								\
 	tracker-backup-glue.h						\
 	tracker-resources-glue.h					\
 	tracker-statistics-glue.h					\
-	tracker-resources-class-glue.h
+	tracker-resources-class-glue.h					\
+	tracker-busy-notifier-glue.h
 
 tracker-marshal.h: tracker-marshal.list
 	$(AM_V_GEN)$(GLIB_GENMARSHAL) $< --prefix=tracker_marshal --header > $@
diff --git a/src/tracker-store/tracker-busy-notifier.c b/src/tracker-store/tracker-busy-notifier.c
new file mode 100644
index 0000000..4e1534d
--- /dev/null
+++ b/src/tracker-store/tracker-busy-notifier.c
@@ -0,0 +1,205 @@
+/*
+ * Copyright (C) 2008, Nokia
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA  02110-1301, USA.
+ *
+ * Authors:
+ *  Philip Van Hoof <philip codeminded be>
+ */
+
+#include "config.h"
+
+#include <string.h>
+
+#include <libtracker-common/tracker-dbus.h>
+
+#include "tracker-dbus.h"
+#include "tracker-busy-notifier.h"
+#include "tracker-marshal.h"
+
+#define TRACKER_BUSY_NOTIFIER_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), TRACKER_TYPE_BUSY_NOTIFIER, TrackerBusyNotifierPrivate))
+
+#define PROGRESS_TIMEOUT_S 5
+
+typedef struct {
+	gdouble progress;
+	gchar *status;
+	guint timer_id;
+	TrackerBusyNotifier *object;
+} TrackerBusyNotifierPrivate;
+
+enum {
+	PROGRESS,
+	LAST_SIGNAL
+};
+
+static void tracker_busy_notifier_finalize (GObject *object);
+
+G_DEFINE_TYPE(TrackerBusyNotifier, tracker_busy_notifier, G_TYPE_OBJECT)
+
+static guint signals[LAST_SIGNAL] = {0};
+
+
+TrackerBusyNotifier *
+tracker_busy_notifier_new (void)
+{
+	return g_object_new (TRACKER_TYPE_BUSY_NOTIFIER, NULL);
+}
+
+static void
+tracker_busy_notifier_class_init (TrackerBusyNotifierClass *klass)
+{
+	GObjectClass *object_class;
+
+	object_class = G_OBJECT_CLASS (klass);
+
+	object_class->finalize = tracker_busy_notifier_finalize;
+
+	/**
+	 * TrackerBusyNotifier::progress:
+	 * @notifier: the TrackerBusyNotifier
+	 * @status: store status
+	 * @progress: a #gdouble indicating store progress, from 0 to 1.
+	 *
+	 * the ::progress signal will be emitted by TrackerBusyNotifier
+	 * to indicate progress about the store process. @status will
+	 * contain a translated string with the current status and @progress
+	 * will indicate how much has been processed so far.
+	 **/
+	signals[PROGRESS] =
+		g_signal_new ("progress",
+		              G_OBJECT_CLASS_TYPE (object_class),
+		              G_SIGNAL_RUN_LAST,
+		              G_STRUCT_OFFSET (TrackerBusyNotifierClass, progress),
+		              NULL, NULL,
+		              tracker_marshal_VOID__STRING_DOUBLE,
+		              G_TYPE_NONE, 2,
+		              G_TYPE_STRING,
+		              G_TYPE_DOUBLE);
+
+	g_type_class_add_private (object_class, sizeof (TrackerBusyNotifierPrivate));
+}
+
+
+static void
+tracker_busy_notifier_finalize (GObject *object)
+{
+	TrackerBusyNotifierPrivate *priv = TRACKER_BUSY_NOTIFIER_GET_PRIVATE (object);
+	g_source_remove (priv->timer_id);
+	g_free (priv->status);
+}
+
+
+static void
+tracker_busy_notifier_init (TrackerBusyNotifier *object)
+{
+	TrackerBusyNotifierPrivate *priv = TRACKER_BUSY_NOTIFIER_GET_PRIVATE (object);
+
+	priv->object = object;
+	priv->timer_id = 0;
+}
+
+static gboolean
+busy_notification_timeout (gpointer user_data)
+{
+	TrackerBusyNotifierPrivate *priv = user_data;
+
+	g_signal_emit (priv->object, signals[PROGRESS], 0,
+	               priv->status,
+	               priv->progress);
+
+	return FALSE;
+}
+
+static void
+busy_notification_destroy (gpointer user_data)
+{
+	TrackerBusyNotifierPrivate *priv = user_data;
+
+	priv->timer_id = 0;
+}
+
+
+static void
+tracker_busy_notifier_callback (const gchar *status,
+                                gdouble progress,
+                                gpointer user_data)
+{
+	static gboolean first_time = TRUE;
+	TrackerBusyNotifierPrivate *priv = user_data;
+	priv->progress = progress;
+
+	if (g_strcmp0 (status, priv->status) != 0) {
+		g_free (priv->status);
+		priv->status = g_strdup (status);
+	}
+
+	if (priv->timer_id == 0) {
+		if (first_time) {
+			priv->timer_id = g_idle_add_full (G_PRIORITY_DEFAULT,
+			                                  busy_notification_timeout,
+			                                  priv,
+			                                  busy_notification_destroy);
+			first_time = FALSE;
+		} else {
+			priv->timer_id = g_timeout_add_seconds_full (G_PRIORITY_DEFAULT, PROGRESS_TIMEOUT_S,
+			                                             busy_notification_timeout,
+			                                             priv,
+			                                             busy_notification_destroy);
+		}
+	}
+
+	g_main_context_iteration (NULL, FALSE);
+}
+
+TrackerBusyCallback
+tracker_busy_notifier_get_callback (TrackerBusyNotifier *object, gpointer *user_data)
+{
+	TrackerBusyNotifierPrivate *priv = TRACKER_BUSY_NOTIFIER_GET_PRIVATE (object);
+	*user_data = priv;
+	return tracker_busy_notifier_callback;
+}
+
+void 
+tracker_busy_notifier_get_progress  (TrackerBusyNotifier    *object,
+                                     DBusGMethodInvocation  *context,
+                                     GError                **error)
+{
+	TrackerBusyNotifierPrivate *priv = TRACKER_BUSY_NOTIFIER_GET_PRIVATE (object);
+	guint request_id;
+
+	request_id = tracker_dbus_get_next_request_id ();
+	dbus_g_method_return (context, priv->progress);
+	tracker_dbus_request_success (request_id, context);
+
+	return;
+}
+
+
+void 
+tracker_busy_notifier_get_status  (TrackerBusyNotifier    *object,
+                                   DBusGMethodInvocation  *context,
+                                   GError                **error)
+{
+	TrackerBusyNotifierPrivate *priv = TRACKER_BUSY_NOTIFIER_GET_PRIVATE (object);
+	guint request_id;
+
+	request_id = tracker_dbus_get_next_request_id ();
+	dbus_g_method_return (context, priv->status);
+	tracker_dbus_request_success (request_id, context);
+
+	return;
+}
diff --git a/src/tracker-store/tracker-busy-notifier.h b/src/tracker-store/tracker-busy-notifier.h
new file mode 100644
index 0000000..b825d94
--- /dev/null
+++ b/src/tracker-store/tracker-busy-notifier.h
@@ -0,0 +1,74 @@
+/*
+ * Copyright (C) 2008, Nokia
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA  02110-1301, USA.
+ *
+ * Authors:
+ *  Philip Van Hoof <philip codeminded be>
+ */
+
+#ifndef __TRACKER_STORE_BUSY_NOTIFIER_H__
+#define __TRACKER_STORE_BUSY_NOTIFIER_H__
+
+#include <glib-object.h>
+#include <libtracker-common/tracker-dbus.h>
+#include <libtracker-data/tracker-data-update.h>
+
+#define TRACKER_BUSY_NOTIFIER_SERVICE         "org.freedesktop.Tracker1"
+#define TRACKER_BUSY_NOTIFIER_PATH            "/org/freedesktop/Tracker1/BusyNotifier"
+#define TRACKER_BUSY_NOTIFIER_INTERFACE       "org.freedesktop.Tracker1.BusyNotifier"
+
+G_BEGIN_DECLS
+
+#define TRACKER_TYPE_BUSY_NOTIFIER            (tracker_busy_notifier_get_type ())
+#define TRACKER_BUSY_NOTIFIER(object)         (G_TYPE_CHECK_INSTANCE_CAST ((object), TRACKER_TYPE_BUSY_NOTIFIER, TrackerBusyNotifier))
+#define TRACKER_BUSY_NOTIFIER_CLASS(klass)    (G_TYPE_CHECK_NOTIFIER_CAST ((klass), TRACKER_TYPE_BUSY_NOTIFIER, TrackerBusyNotifierClass))
+#define TRACKER_IS_BUSY_NOTIFIER(object)      (G_TYPE_CHECK_INSTANCE_TYPE ((object), TRACKER_TYPE_BUSY_NOTIFIER))
+#define TRACKER_IS_BUSY_NOTIFIER_CLASS(klass) (G_TYPE_CHECK_NOTIFIER_TYPE ((klass), TRACKER_TYPE_BUSY_NOTIFIER))
+#define TRACKER_BUSY_NOTIFIER_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_NOTIFIER ((obj), TRACKER_TYPE_BUSY_NOTIFIER, TrackerBusyNotifierClass))
+
+typedef struct TrackerBusyNotifier       TrackerBusyNotifier;
+typedef struct TrackerBusyNotifierClass TrackerBusyNotifierClass;
+
+struct TrackerBusyNotifier {
+	GObject parent;
+};
+
+struct TrackerBusyNotifierClass {
+	GObjectClass parent;
+
+	void (* progress) (TrackerBusyNotifier *notifier,
+	                   const gchar         *status,
+	                   gdouble              progress);
+};
+
+GType                 tracker_busy_notifier_get_type      (void);
+TrackerBusyNotifier  *tracker_busy_notifier_new           (void);
+TrackerBusyCallback   tracker_busy_notifier_get_callback  (TrackerBusyNotifier    *object,
+                                                           gpointer               *user_data);
+
+/* DBus methods */
+void                  tracker_busy_notifier_get_progress  (TrackerBusyNotifier    *object,
+                                                           DBusGMethodInvocation  *context,
+                                                           GError                **error);
+void                  tracker_busy_notifier_get_status    (TrackerBusyNotifier    *object,
+                                                           DBusGMethodInvocation  *context,
+                                                           GError                **error);
+
+
+G_END_DECLS
+
+#endif /* __TRACKER_STORE_BUSY_NOTIFIER_H__ */
diff --git a/src/tracker-store/tracker-dbus.c b/src/tracker-store/tracker-dbus.c
index 3b3bb1c..32d49fe 100644
--- a/src/tracker-store/tracker-dbus.c
+++ b/src/tracker-store/tracker-dbus.c
@@ -35,6 +35,8 @@
 #include "tracker-resources-glue.h"
 #include "tracker-resource-class.h"
 #include "tracker-resources-class-glue.h"
+#include "tracker-busy-notifier.h"
+#include "tracker-busy-notifier-glue.h"
 #include "tracker-statistics.h"
 #include "tracker-statistics-glue.h"
 #include "tracker-backup.h"
@@ -185,6 +187,33 @@ name_owner_changed_closure (gpointer  data,
 {
 }
 
+TrackerBusyNotifier*
+tracker_dbus_register_busy_notifier (void)
+{
+	gpointer object;
+
+	if (!connection || !gproxy) {
+		g_critical ("D-Bus support must be initialized before registering objects!");
+		return FALSE;
+	}
+
+	/* Add org.freedesktop.Tracker */
+	object = tracker_busy_notifier_new ();
+	if (!object) {
+		g_critical ("Could not create TrackerBusyNotifier object to register");
+		return FALSE;
+	}
+
+	dbus_register_object (connection,
+	                      gproxy,
+	                      G_OBJECT (object),
+	                      &dbus_glib_tracker_busy_notifier_object_info,
+	                      TRACKER_BUSY_NOTIFIER_PATH);
+	objects = g_slist_prepend (objects, object);
+
+	return g_object_ref (object);
+}
+
 gboolean
 tracker_dbus_register_objects (void)
 {
diff --git a/src/tracker-store/tracker-dbus.h b/src/tracker-store/tracker-dbus.h
index 84dba0d..07069f8 100644
--- a/src/tracker-store/tracker-dbus.h
+++ b/src/tracker-store/tracker-dbus.h
@@ -25,12 +25,15 @@
 
 #include <dbus/dbus-glib-bindings.h>
 
+#include "tracker-busy-notifier.h"
+
 G_BEGIN_DECLS
 
-gboolean    tracker_dbus_init                    (void);
-void        tracker_dbus_shutdown                (void);
-gboolean    tracker_dbus_register_objects        (void);
-GObject    *tracker_dbus_get_object              (GType type);
+gboolean             tracker_dbus_init                    (void);
+void                 tracker_dbus_shutdown                (void);
+gboolean             tracker_dbus_register_objects        (void);
+GObject             *tracker_dbus_get_object              (GType type);
+TrackerBusyNotifier *tracker_dbus_register_busy_notifier  (void);
 
 G_END_DECLS
 
diff --git a/src/tracker-store/tracker-main.c b/src/tracker-store/tracker-main.c
index 7c4b8e4..dccb6dc 100644
--- a/src/tracker-store/tracker-main.c
+++ b/src/tracker-store/tracker-main.c
@@ -336,6 +336,9 @@ main (gint argc, gchar *argv[])
 	TrackerConfig *config;
 	TrackerDBManagerFlags flags = 0;
 	gboolean is_first_time_index;
+	TrackerBusyNotifier *notifier;
+	gpointer busy_user_data;
+	TrackerBusyCallback busy_callback;
 
 	g_type_init ();
 
@@ -444,15 +447,24 @@ main (gint argc, gchar *argv[])
 		flags |= TRACKER_DB_MANAGER_LOW_MEMORY_MODE;
 	}
 
+	notifier = tracker_dbus_register_busy_notifier ();
+	busy_callback = tracker_busy_notifier_get_callback (notifier, 
+	                                                    &busy_user_data);
+
 	if (!tracker_data_manager_init (flags,
 	                                NULL,
 	                                &is_first_time_index,
 	                                TRUE,
-	                                NULL,
-	                                NULL)) {
+	                                busy_callback,
+	                                busy_user_data,
+	                                "Journal replaying")) {
+
+		g_object_unref (notifier);
 		return EXIT_FAILURE;
 	}
 
+	g_object_unref (notifier);
+
 	tracker_store_init ();
 
 	if (private->shutdown) {
diff --git a/src/tracker-store/tracker-marshal.list b/src/tracker-store/tracker-marshal.list
index 910ccde..3dafeb6 100644
--- a/src/tracker-store/tracker-marshal.list
+++ b/src/tracker-store/tracker-marshal.list
@@ -8,3 +8,4 @@ VOID:BOXED,BOXED
 # Indexer signals
 VOID:DOUBLE,UINT,UINT,BOOL
 VOID:DOUBLE,STRING,UINT,UINT,UINT
+VOID:STRING,DOUBLE
diff --git a/tests/libtracker-data/tracker-backup-test.c b/tests/libtracker-data/tracker-backup-test.c
index f7fb27c..260ba69 100644
--- a/tests/libtracker-data/tracker-backup-test.c
+++ b/tests/libtracker-data/tracker-backup-test.c
@@ -106,7 +106,7 @@ test_backup_and_restore (void)
 
 	tracker_data_manager_init (TRACKER_DB_MANAGER_FORCE_REINDEX,
 	                           (const gchar **) test_schemas,
-	                           NULL, FALSE, NULL, NULL);
+	                           NULL, FALSE, NULL, NULL, NULL);
 
 	/* load data set */
 	data_filename = g_strconcat (data_prefix, ".data", NULL);
@@ -156,7 +156,7 @@ test_backup_and_restore (void)
 
 	tracker_data_manager_init (TRACKER_DB_MANAGER_FORCE_REINDEX,
 	                           (const gchar **) test_schemas,
-	                           NULL, FALSE, NULL, NULL);
+	                           NULL, FALSE, NULL, NULL, NULL);
 	check_content_in_db (0, 0);
 
 	test_schemas[0] = data_prefix;
diff --git a/tests/libtracker-data/tracker-ontology-test.c b/tests/libtracker-data/tracker-ontology-test.c
index da196c1..10d64c2 100644
--- a/tests/libtracker-data/tracker-ontology-test.c
+++ b/tests/libtracker-data/tracker-ontology-test.c
@@ -264,7 +264,7 @@ test_ontology_change (void)
                 g_chmod (ontology_file, 0666);
 
 		tracker_data_manager_init (0, (const gchar **) test_schemas,
-		                           NULL, FALSE, NULL, NULL);
+		                           NULL, FALSE, NULL, NULL, NULL);
 
 		if (g_file_get_contents (update, &queries, NULL, NULL)) {
 			gchar *query = strtok (queries, "\n");
@@ -290,7 +290,7 @@ test_ontology_change (void)
 	delete_db (FALSE);
 
 	tracker_data_manager_init (0, (const gchar **) test_schemas,
-	                           NULL, TRUE, NULL, NULL);
+	                           NULL, TRUE, NULL, NULL, NULL);
 
 	for (i = 0; change_tests[i].test_name != NULL; i++) {
 		gchar *query_filename;
@@ -329,6 +329,7 @@ test_ontology_init (void)
 	                           NULL,
 	                           FALSE,
 	                           NULL,
+	                           NULL,
 	                           NULL);
 
 	tracker_data_manager_shutdown ();
@@ -339,6 +340,7 @@ test_ontology_init (void)
 	                           NULL,
 	                           FALSE,
 	                           NULL,
+	                           NULL,
 	                           NULL);
 
 	tracker_data_manager_shutdown ();
@@ -369,6 +371,7 @@ test_query (gconstpointer test_data)
 	                           NULL, 
 	                           FALSE,
 	                           NULL,
+	                           NULL,
 	                           NULL);
 
 	/* load data set */
diff --git a/tests/libtracker-data/tracker-sparql-blank-test.c b/tests/libtracker-data/tracker-sparql-blank-test.c
index 32ecc60..5b2f9b7 100644
--- a/tests/libtracker-data/tracker-sparql-blank-test.c
+++ b/tests/libtracker-data/tracker-sparql-blank-test.c
@@ -46,6 +46,7 @@ test_blank (void)
 	                           NULL,
 	                           FALSE,
 	                           NULL,
+	                           NULL,
 	                           NULL);
 
 	/* perform update in transaction */
diff --git a/tests/libtracker-data/tracker-sparql-test.c b/tests/libtracker-data/tracker-sparql-test.c
index ded8f4f..b8c0630 100644
--- a/tests/libtracker-data/tracker-sparql-test.c
+++ b/tests/libtracker-data/tracker-sparql-test.c
@@ -131,7 +131,7 @@ test_sparql_query (gconstpointer test_data)
 	test_schemas[0] = data_prefix;
 	tracker_data_manager_init (TRACKER_DB_MANAGER_FORCE_REINDEX,
 	                           test_schemas,
-	                           NULL, FALSE, NULL, NULL);
+	                           NULL, FALSE, NULL, NULL, NULL);
 
 	/* data_path = g_build_path (G_DIR_SEPARATOR_S, TOP_SRCDIR, "tests", "libtracker-data", NULL); */
 
diff --git a/tests/libtracker-fts/tracker-fts-test.c b/tests/libtracker-fts/tracker-fts-test.c
index 5658279..84ec1fa 100644
--- a/tests/libtracker-fts/tracker-fts-test.c
+++ b/tests/libtracker-fts/tracker-fts-test.c
@@ -74,7 +74,7 @@ test_sparql_query (gconstpointer test_data)
 	test_schemas[0] = data_prefix;
 	tracker_data_manager_init (TRACKER_DB_MANAGER_FORCE_REINDEX,
 	                           test_schemas,
-	                           NULL, FALSE, NULL, NULL);
+	                           NULL, FALSE, NULL, NULL, NULL);
 
 	/* load data / perform updates */
 



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