[tracker/tracker-store] Move crawling and monitoring from tracker-store to tracker-indexer



commit 3c56d94dbabd182ab466c4792be95a900d7c9806
Author: Jürg Billeter <j bitron ch>
Date:   Tue May 19 17:44:43 2009 +0200

    Move crawling and monitoring from tracker-store to tracker-indexer
---
 data/dbus/tracker-indexer.xml                      |   22 ---
 src/libtracker-common/Makefile.am                  |    2 +
 .../tracker-status.c                               |  173 ++----------------
 .../tracker-status.h                               |    0
 src/tracker-indexer/Makefile.am                    |   11 ++
 .../tracker-crawler.c                              |    3 +-
 .../tracker-crawler.h                              |    0
 src/tracker-indexer/tracker-indexer.c              |  137 ++++++--------
 src/tracker-indexer/tracker-indexer.h              |   20 +--
 src/tracker-indexer/tracker-marshal.list           |    4 +
 .../tracker-monitor.c                              |    2 +-
 .../tracker-monitor.h                              |    0
 .../tracker-processor.c                            |  188 +++++---------------
 .../tracker-processor.h                            |    5 +-
 src/tracker-store/Makefile.am                      |   14 --
 src/tracker-store/tracker-daemon.c                 |   33 +----
 src/tracker-store/tracker-daemon.h                 |    5 +-
 src/tracker-store/tracker-dbus.c                   |    7 +-
 src/tracker-store/tracker-dbus.h                   |    5 +-
 src/tracker-store/tracker-main.c                   |  131 +-------------
 src/tracker-store/tracker-marshal.list             |    4 -
 src/tracker-store/tracker-resources.c              |    1 +
 tests/tracker-indexer/Makefile.am                  |    8 +
 23 files changed, 171 insertions(+), 604 deletions(-)

diff --git a/data/dbus/tracker-indexer.xml b/data/dbus/tracker-indexer.xml
index 101980a..93df228 100644
--- a/data/dbus/tracker-indexer.xml
+++ b/data/dbus/tracker-indexer.xml
@@ -16,28 +16,6 @@
       <arg type="s" name="file" direction="in" />
     </method>
 
-    <method name="FilesCheck">
-      <annotation name="org.freedesktop.DBus.GLib.Async" value="true"/>
-      <arg type="s" name="module" direction="in" />
-      <arg type="as" name="files" direction="in" />
-    </method>
-    <method name="FilesUpdate">
-      <annotation name="org.freedesktop.DBus.GLib.Async" value="true"/>
-      <arg type="s" name="module" direction="in" />
-      <arg type="as" name="files" direction="in" />
-    </method>
-    <method name="FilesDelete">
-      <annotation name="org.freedesktop.DBus.GLib.Async" value="true"/>
-      <arg type="s" name="module" direction="in" />
-      <arg type="as" name="files" direction="in" />
-    </method>
-    <method name="FileMove">
-      <annotation name="org.freedesktop.DBus.GLib.Async" value="true"/>
-      <arg type="s" name="module" direction="in" />
-      <arg type="s" name="file_from" direction="in" />
-      <arg type="s" name="file_to" direction="in" />
-    </method>
-
     <method name="VolumeDisableAll">
       <annotation name="org.freedesktop.DBus.GLib.Async"
       value="true"/>
diff --git a/src/libtracker-common/Makefile.am b/src/libtracker-common/Makefile.am
index caf9c7e..df109a5 100644
--- a/src/libtracker-common/Makefile.am
+++ b/src/libtracker-common/Makefile.am
@@ -52,6 +52,7 @@ libtracker_common_la_SOURCES =	 			\
 	tracker-parser.c				\
 	tracker-property.c				\
 	tracker-statement-list.c			\
+	tracker-status.c				\
 	tracker-type-utils.c				\
 	tracker-utils.c					\
 	tracker-thumbnailer.c				\
@@ -79,6 +80,7 @@ libtracker_commoninclude_HEADERS =			\
 	tracker-parser.h				\
 	tracker-property.h				\
 	tracker-statement-list.h			\
+	tracker-status.h				\
 	tracker-type-utils.h				\
 	tracker-utils.h
 
diff --git a/src/tracker-store/tracker-status.c b/src/libtracker-common/tracker-status.c
similarity index 84%
rename from src/tracker-store/tracker-status.c
rename to src/libtracker-common/tracker-status.c
index 704c6bd..2e65ca2 100644
--- a/src/tracker-store/tracker-status.c
+++ b/src/libtracker-common/tracker-status.c
@@ -28,10 +28,6 @@
 #include <unistd.h>
 
 #include "tracker-status.h"
-#include "tracker-dbus.h"
-#include "tracker-daemon.h"
-#include "tracker-main.h"
-#include "tracker-indexer-client.h"
 
 #define DISK_SPACE_CHECK_FREQUENCY 10
 
@@ -53,8 +49,6 @@ typedef struct {
 	TrackerPower  *hal;
 
 
-	DBusGProxy    *indexer_proxy;
-
 	gboolean       is_readonly;
 	gboolean       is_ready;
 	gboolean       is_running;
@@ -68,13 +62,6 @@ typedef struct {
 	gboolean       in_merge;
 } TrackerStatusPrivate;
 
-static void indexer_continued_cb    (DBusGProxy  *proxy,
-				     gpointer     user_data);
-static void indexer_paused_cb       (DBusGProxy  *proxy,
-				     const gchar *reason,
-				     gpointer     user_data);
-static void indexer_continue        (gboolean     should_block);
-static void indexer_pause           (gboolean     should_block);
 static void low_disk_space_limit_cb (GObject     *gobject,
 				     GParamSpec  *arg1,
 				     gpointer     user_data);
@@ -120,18 +107,6 @@ private_free (gpointer data)
 		g_type_class_unref (private->type_class);
 	}
 
-	dbus_g_proxy_disconnect_signal (private->indexer_proxy, "Continued",
-					G_CALLBACK (indexer_continued_cb),
-					NULL);
-	dbus_g_proxy_disconnect_signal (private->indexer_proxy, "Paused",
-					G_CALLBACK (indexer_paused_cb),
-					NULL);
-	dbus_g_proxy_disconnect_signal (private->indexer_proxy, "Finished",
-					G_CALLBACK (indexer_continued_cb),
-					NULL);
-
-	g_object_unref (private->indexer_proxy);
-
 	g_free (private);
 }
 
@@ -140,8 +115,7 @@ private_free (gpointer data)
  */
 
 static void
-indexer_recheck (gboolean should_inform_indexer,
-		 gboolean should_block,
+indexer_recheck (gboolean should_block,
 		 gboolean should_signal_small_changes)
 {
 	TrackerStatusPrivate *private;
@@ -158,24 +132,14 @@ indexer_recheck (gboolean should_inform_indexer,
 	    private->is_paused_for_unknown) {
 		/* We are paused, but our status is NOT paused? */
 		if (private->status != TRACKER_STATUS_PAUSED) {
-			if (G_LIKELY (should_inform_indexer)) {
-				/* We set state after confirmation*/
-				indexer_pause (should_block);
-			} else {
-				tracker_status_set_and_signal (TRACKER_STATUS_PAUSED);
-			}
+			tracker_status_set_and_signal (TRACKER_STATUS_PAUSED);
 			
 			return;
 		}
 	} else {
 		/* We are not paused, but our status is paused */
 		if (private->status == TRACKER_STATUS_PAUSED) {
-			if (G_LIKELY (should_inform_indexer)) {
-				/* We set state after confirmation*/
-				indexer_continue (should_block);
-			} else {
-				tracker_status_set_and_signal (private->status_before_paused);
-			}
+			tracker_status_set_and_signal (private->status_before_paused);
 
 			return;
 		}
@@ -189,105 +153,13 @@ indexer_recheck (gboolean should_inform_indexer,
 	}
 }
 
-static void
-indexer_paused_cb (DBusGProxy  *proxy,
-		   const gchar *reason,
-		   gpointer     user_data)
-{
-	g_message ("The indexer has paused");
-}
-
-static void
-indexer_continued_cb (DBusGProxy *proxy,
-		      gpointer	  user_data)
-{
-	g_message ("The indexer has continued");
-}
-
-static void
-indexer_continue_cb (DBusGProxy *proxy,
-		     GError     *error,
-		     gpointer    user_data)
-{
-	TrackerStatusPrivate *private;
-
-	private = g_static_private_get (&private_key);
-	g_return_if_fail (private != NULL);
-
-	if (G_UNLIKELY (error)) {
-		g_message ("Could not continue the indexer, %s",
-			   error->message);
-		return;
-	}
-
-	tracker_status_set_and_signal (private->status_before_paused);
-}
-
-static void
-indexer_continue (gboolean should_block)
-{
-	TrackerStatusPrivate *private;
-
-	/* NOTE: We don't need private, but we do this to check we
-	 * are initialised before calling continue.
-	 */
-	private = g_static_private_get (&private_key);
-	g_return_if_fail (private != NULL);
-
-	if (G_LIKELY (!should_block)) {
-		org_freedesktop_Tracker_Indexer_continue_async (private->indexer_proxy,
-								indexer_continue_cb,
-								NULL);
-	} else {
-		org_freedesktop_Tracker_Indexer_continue (private->indexer_proxy, 
-							  NULL);
-		tracker_status_set_and_signal (private->status_before_paused);
-	}
-}
-
-static void
-indexer_pause_cb (DBusGProxy *proxy,
-		  GError     *error,
-		  gpointer    user_data)
-{
-	if (G_UNLIKELY (error)) {
-		g_message ("Could not pause the indexer, %s",
-			   error->message);
-		return;
-	}
-	
-	tracker_status_set_and_signal (TRACKER_STATUS_PAUSED);
-}
-
-static void
-indexer_pause (gboolean should_block)
-{
-	TrackerStatusPrivate *private;
-
-	/* NOTE: We don't need private, but we do this to check we
-	 * are initialised before calling continue.
-	 */
-	private = g_static_private_get (&private_key);
-	g_return_if_fail (private != NULL);
-
-	if (G_LIKELY (!should_block)) {
-		org_freedesktop_Tracker_Indexer_pause_async (private->indexer_proxy,
-							     indexer_pause_cb,
-							     NULL);
-	} else {
-		org_freedesktop_Tracker_Indexer_pause (private->indexer_proxy, 
-						       NULL);
-		tracker_status_set_and_signal (TRACKER_STATUS_PAUSED);
-	}
-}
-
-
 static gboolean
 disk_space_check (void)
 {
 	TrackerStatusPrivate *private;
 	struct statvfs        st;
 	gint                  limit;
+	gchar                *data_dir;
 
 	private = g_static_private_get (&private_key);
 	g_return_val_if_fail (private != NULL, FALSE);
@@ -298,11 +170,18 @@ disk_space_check (void)
 		return FALSE;
 	}
 
-	if (statvfs (tracker_get_data_dir (), &st) == -1) {
-		g_warning ("Could not statvfs() '%s'", tracker_get_data_dir ());
+	data_dir = g_build_filename (g_get_user_cache_dir (),
+				     "tracker",
+				     NULL);
+
+	if (statvfs (data_dir, &st) == -1) {
+		g_warning ("Could not statvfs() '%s'", data_dir);
+		g_free (data_dir);
 		return FALSE;
 	}
 
+	g_free (data_dir);
+
 	if (((long long) st.f_bavail * 100 / st.f_blocks) <= limit) {
 		g_message ("Disk space is low");
 		return TRUE;
@@ -483,7 +362,6 @@ tracker_status_init (TrackerConfig *config,
 		     TrackerPower  *hal)
 {
 	GType		      type;
-	DBusGProxy           *proxy;
 	TrackerStatusPrivate *private;
 
 	g_return_val_if_fail (TRACKER_IS_CONFIG (config), FALSE);
@@ -571,19 +449,6 @@ tracker_status_init (TrackerConfig *config,
 			      private,
 			      private_free);
 
-	/* Initialize the DBus indexer listening functions */
-	proxy = tracker_dbus_indexer_get_proxy ();
-	private->indexer_proxy = g_object_ref (proxy);
-
-	dbus_g_proxy_connect_signal (proxy, "Paused",
-				     G_CALLBACK (indexer_paused_cb),
-				     NULL,
-				     NULL);
-	dbus_g_proxy_connect_signal (proxy, "Continued",
-				     G_CALLBACK (indexer_continued_cb),
-				     NULL,
-				     NULL);
-	
 	/* Do initial disk space check, we don't start the timeout
 	 * which checks the disk space every 10 seconds here because
 	 * we might not have enough to begin with. So we do one
@@ -818,6 +683,7 @@ tracker_status_set (TrackerStatus new_status)
 void
 tracker_status_signal (void)
 {
+#if 0
 	TrackerStatusPrivate *private;
 	GObject		     *object;
 	gboolean              pause_for_io;
@@ -853,6 +719,7 @@ tracker_status_signal (void)
 			       private->is_paused_for_batt,
 			       pause_for_io,
 			       !private->is_readonly);
+#endif
 }
 
 void
@@ -1064,7 +931,7 @@ tracker_status_set_is_paused_manually (gboolean value)
 	private->is_paused_manually = value;
 
 	/* Set indexer state and our state to paused or not */ 
-	indexer_recheck (TRUE, FALSE, emit);
+	indexer_recheck (FALSE, emit);
 }
 
 gboolean
@@ -1092,7 +959,7 @@ tracker_status_set_is_paused_for_batt (gboolean value)
 	private->is_paused_for_batt = value;
 
 	/* Set indexer state and our state to paused or not */ 
-	indexer_recheck (TRUE, FALSE, emit);
+	indexer_recheck (FALSE, emit);
 }
 
 gboolean
@@ -1120,7 +987,7 @@ tracker_status_set_is_paused_for_io (gboolean value)
 	private->is_paused_for_io = value;
 
 	/* Set indexer state and our state to paused or not */ 
-	indexer_recheck (TRUE, FALSE, emit);
+	indexer_recheck (FALSE, emit);
 }
 
 gboolean
@@ -1148,7 +1015,7 @@ tracker_status_set_is_paused_for_space (gboolean value)
 	private->is_paused_for_space = value;
 
 	/* Set indexer state and our state to paused or not */ 
-	indexer_recheck (TRUE, FALSE, emit);
+	indexer_recheck (FALSE, emit);
 }
 
 gboolean
@@ -1176,6 +1043,6 @@ tracker_status_set_is_paused_for_dbus (gboolean value)
 	private->is_paused_for_dbus = value;
 
 	/* Set indexer state and our state to paused or not */ 
-	indexer_recheck (TRUE, TRUE, emit);
+	indexer_recheck (TRUE, emit);
 }
 
diff --git a/src/tracker-store/tracker-status.h b/src/libtracker-common/tracker-status.h
similarity index 100%
rename from src/tracker-store/tracker-status.h
rename to src/libtracker-common/tracker-status.h
diff --git a/src/tracker-indexer/Makefile.am b/src/tracker-indexer/Makefile.am
index 201dd01..54a6c35 100644
--- a/src/tracker-indexer/Makefile.am
+++ b/src/tracker-indexer/Makefile.am
@@ -19,6 +19,10 @@ INCLUDES =								\
 	$(GCOV_CFLAGS)							\
 	$(RAPTOR_CFLAGS)
 
+if HAVE_INOTIFY
+inotify_libs = $(top_builddir)/src/libinotify/libinotify.la
+endif
+
 libtracker_moduledir = $(libdir)/tracker-$(TRACKER_API_VERSION)
 libtracker_moduleincludedir=$(includedir)/tracker-$(TRACKER_API_VERSION)/libtracker-module/
 libtracker_module_LTLIBRARIES = libtracker-module.la
@@ -43,6 +47,8 @@ libexec_PROGRAMS = tracker-indexer
 
 tracker_indexer_SOURCES =						\
 	tracker-dbus.h							\
+	tracker-crawler.c						\
+	tracker-crawler.h						\
 	tracker-indexer.c						\
 	tracker-indexer.h						\
 	tracker-indexer-module.c					\
@@ -50,6 +56,10 @@ tracker_indexer_SOURCES =						\
 	tracker-main.c							\
 	tracker-module-metadata-private.h				\
 	tracker-marshal-main.c						\
+	tracker-monitor.c						\
+	tracker-monitor.h						\
+	tracker-processor.c						\
+	tracker-processor.h						\
 	tracker-removable-device.c					\
 	tracker-removable-device.h					
 
@@ -62,6 +72,7 @@ tracker_indexer_LDADD =							\
 	$(top_builddir)/src/libtracker/libtrackerclient- TRACKER_API_VERSION@.la \
 	$(top_builddir)/src/libstemmer/libstemmer.la	 		\
 	$(tracker_store_win_libs)						\
+	$(inotify_libs)							\
 	$(DBUS_LIBS)							\
 	$(GMODULE_LIBS)							\
 	$(GTHREAD_LIBS)							\
diff --git a/src/tracker-store/tracker-crawler.c b/src/tracker-indexer/tracker-crawler.c
similarity index 99%
rename from src/tracker-store/tracker-crawler.c
rename to src/tracker-indexer/tracker-crawler.c
index 36560e9..2f469be 100644
--- a/src/tracker-store/tracker-crawler.c
+++ b/src/tracker-indexer/tracker-crawler.c
@@ -26,16 +26,15 @@
 
 #include <libtracker-common/tracker-dbus.h>
 #include <libtracker-common/tracker-file-utils.h>
+#include <libtracker-common/tracker-status.h>
 #include <libtracker-common/tracker-type-utils.h>
 #include <libtracker-common/tracker-utils.h>
 #include <libtracker-common/tracker-module-config.h>
 
 #include "tracker-crawler.h"
 #include "tracker-dbus.h"
-#include "tracker-indexer-client.h"
 #include "tracker-monitor.h"
 #include "tracker-marshal.h"
-#include "tracker-status.h"
 
 #define TRACKER_CRAWLER_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), TRACKER_TYPE_CRAWLER, TrackerCrawlerPrivate))
 
diff --git a/src/tracker-store/tracker-crawler.h b/src/tracker-indexer/tracker-crawler.h
similarity index 100%
rename from src/tracker-store/tracker-crawler.h
rename to src/tracker-indexer/tracker-crawler.h
diff --git a/src/tracker-indexer/tracker-indexer.c b/src/tracker-indexer/tracker-indexer.c
index 1298d6c..e4cba40 100644
--- a/src/tracker-indexer/tracker-indexer.c
+++ b/src/tracker-indexer/tracker-indexer.c
@@ -67,6 +67,7 @@
 #include <libtracker-common/tracker-parser.h>
 #include <libtracker-common/tracker-ontology.h>
 #include <libtracker-common/tracker-module-config.h>
+#include <libtracker-common/tracker-status.h>
 #include <libtracker-common/tracker-utils.h>
 #include <libtracker-common/tracker-thumbnailer.h>
 
@@ -84,6 +85,7 @@
 #include "tracker-indexer-module.h"
 #include "tracker-marshal.h"
 #include "tracker-module-metadata-private.h"
+#include "tracker-processor.h"
 #include "tracker-removable-device.h"
 
 #define TRACKER_INDEXER_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), TRACKER_TYPE_INDEXER, TrackerIndexerPrivate))
@@ -141,6 +143,8 @@ struct TrackerIndexerPrivate {
 	TrackerPower   *hal_power;
 	TrackerStorage *hal_storage;
 
+	TrackerProcessor *processor;
+
 	TrackerClient *client;
 
 	GTimer *timer;
@@ -576,6 +580,10 @@ tracker_indexer_finalize (GObject *object)
 	g_object_unref (priv->hal_storage);
 #endif /* HAVE_HAL */
 
+	if (priv->processor) {
+		g_object_unref (priv->processor);
+	}
+
 	if (priv->client) {
 		tracker_disconnect (priv->client);
 	}
@@ -878,10 +886,29 @@ tracker_indexer_load_modules (TrackerIndexer *indexer)
 	g_list_free (modules);
 }
 
+static gboolean
+start_cb (gpointer user_data)
+{
+	TrackerIndexer        *indexer;
+
+	if (!tracker_status_get_is_ready ()) {
+		return FALSE;
+	}
+
+	indexer = TRACKER_INDEXER (user_data);
+
+	if (indexer->private->processor) {
+		tracker_processor_start (indexer->private->processor);
+	}
+
+	return FALSE;
+}
+
 static void
 tracker_indexer_init (TrackerIndexer *indexer)
 {
 	TrackerIndexerPrivate *priv;
+	gint seconds;
 
 	priv = indexer->private = TRACKER_INDEXER_GET_PRIVATE (indexer);
 
@@ -915,6 +942,20 @@ tracker_indexer_init (TrackerIndexer *indexer)
 	set_up_throttle (indexer);
 #endif /* HAVE_HAL */
 
+	tracker_status_init (priv->config, priv->hal_power);
+
+	/* Set our status as running, if this is FALSE, threads stop
+	 * doing what they do and shutdown.
+	 */
+	tracker_status_set_is_ready (TRUE);
+
+	/* We set the state here because it is not set in the
+	 * processor otherwise.
+	 */
+	tracker_status_set_and_signal (TRACKER_STATUS_IDLE);
+
+	priv->processor = tracker_processor_new (priv->config, priv->hal_storage, indexer);
+
 	priv->language = tracker_language_new (priv->config);
 
 	priv->db_dir = g_build_filename (g_get_user_cache_dir (),
@@ -930,6 +971,16 @@ tracker_indexer_init (TrackerIndexer *indexer)
 
 	/* Set up idle handler to process files/directories */
 	state_check (indexer);
+
+	seconds = tracker_config_get_initial_sleep (priv->config);
+
+	if (seconds > 0) {
+		g_message ("Waiting %d seconds before starting",
+		           seconds);
+		g_timeout_add_seconds (seconds, start_cb, indexer);
+	} else {
+		g_idle_add (start_cb, indexer);
+	}
 }
 
 static void
@@ -2070,36 +2121,16 @@ tracker_indexer_turtle_add (TrackerIndexer *indexer,
 void
 tracker_indexer_files_check (TrackerIndexer *indexer,
 			     const gchar *module_name,
-			     GStrv files,
-			     DBusGMethodInvocation *context,
-			     GError **error)
+			     GStrv files)
 {
 	TrackerIndexerModule *module;
-	guint request_id;
 	gint i;
-	GError *actual_error = NULL;
 
-	request_id = tracker_dbus_get_next_request_id ();
-
-	tracker_dbus_async_return_if_fail (TRACKER_IS_INDEXER (indexer), context);
-	tracker_dbus_async_return_if_fail (files != NULL, context);
-
-	tracker_dbus_request_new (request_id,
-				  "DBus request to check %d files",
-				  g_strv_length (files));
+	g_return_if_fail (TRACKER_IS_INDEXER (indexer));
+	g_return_if_fail (files != NULL);
 
 	module = g_hash_table_lookup (indexer->private->indexer_modules, module_name);
 
-	if (!module) {
-		tracker_dbus_request_failed (request_id,
-					     &actual_error,
-					     "The module '%s' is not loaded",
-					     module_name);
-		dbus_g_method_return_error (context, actual_error);
-		g_error_free (actual_error);
-		return;
-	}
-
 	/* Add files to the queue */
 	for (i = 0; files[i]; i++) {
 		GFile *file;
@@ -2111,71 +2142,24 @@ tracker_indexer_files_check (TrackerIndexer *indexer,
 
 		g_object_unref (file);
 	}
-
-	dbus_g_method_return (context);
-	tracker_dbus_request_success (request_id);
-}
-
-/* FIXME: Should get rid of this DBus method */
-void
-tracker_indexer_files_update (TrackerIndexer *indexer,
-			      const gchar *module_name,
-			      GStrv files,
-			      DBusGMethodInvocation *context,
-			      GError **error)
-{
-	tracker_indexer_files_check (indexer, module_name,
-				     files, context, error);
-}
-
-/* FIXME: Should get rid of this DBus method */
-void
-tracker_indexer_files_delete (TrackerIndexer *indexer,
-			      const gchar *module_name,
-			      GStrv files,
-			      DBusGMethodInvocation *context,
-			      GError **error)
-{
-	tracker_indexer_files_check (indexer, module_name,
-				     files, context, error);
 }
 
 void
 tracker_indexer_file_move (TrackerIndexer	  *indexer,
 			   const gchar		  *module_name,
-			   gchar		  *from,
-			   gchar		  *to,
-			   DBusGMethodInvocation  *context,
-			   GError		 **error)
+			   const gchar		  *from,
+			   const gchar		  *to)
 {
 	TrackerIndexerModule *module;
-	guint request_id;
-	GError *actual_error;
 	PathInfo *info;
 	GFile *file_from, *file_to;
 
-	request_id = tracker_dbus_get_next_request_id ();
-
-	tracker_dbus_async_return_if_fail (TRACKER_IS_INDEXER (indexer), context);
-	tracker_dbus_async_return_if_fail (from != NULL, context);
-	tracker_dbus_async_return_if_fail (to != NULL, context);
-
-	tracker_dbus_request_new (request_id,
-				  "DBus request to move '%s' to '%s'",
-				  from, to);
+	g_return_if_fail (TRACKER_IS_INDEXER (indexer));
+	g_return_if_fail (from != NULL);
+	g_return_if_fail (to != NULL);
 
 	module = g_hash_table_lookup (indexer->private->indexer_modules, module_name);
 
-	if (!module) {
-		tracker_dbus_request_failed (request_id,
-					     &actual_error,
-					     "The module '%s' is not loaded",
-					     module_name);
-		dbus_g_method_return_error (context, actual_error);
-		g_error_free (actual_error);
-		return;
-	}
-
 	file_from = g_file_new_for_path (from);
 	file_to = g_file_new_for_path (to);
 
@@ -2183,9 +2167,6 @@ tracker_indexer_file_move (TrackerIndexer	  *indexer,
 	info = path_info_new (module, file_to, file_from, TRUE);
 	add_file (indexer, info);
 
-	dbus_g_method_return (context);
-	tracker_dbus_request_success (request_id);
-
 	g_object_unref (file_from);
 	g_object_unref (file_to);
 }
diff --git a/src/tracker-indexer/tracker-indexer.h b/src/tracker-indexer/tracker-indexer.h
index 23ebfdf..ccc9756 100644
--- a/src/tracker-indexer/tracker-indexer.h
+++ b/src/tracker-indexer/tracker-indexer.h
@@ -109,25 +109,11 @@ void		tracker_indexer_turtle_add	   (TrackerIndexer *indexer,
 						    GError **error);
 void            tracker_indexer_files_check         (TrackerIndexer         *indexer,
 						     const gchar            *module,
-						     GStrv                   files,
-						     DBusGMethodInvocation  *context,
-						     GError                **error);
-void            tracker_indexer_files_update        (TrackerIndexer         *indexer,
-						     const gchar            *module,
-						     GStrv                   files,
-						     DBusGMethodInvocation  *context,
-						     GError                **error);
-void            tracker_indexer_files_delete        (TrackerIndexer         *indexer,
-						     const gchar            *module,
-						     GStrv                   files,
-						     DBusGMethodInvocation  *context,
-						     GError                **error);
+						     GStrv                   files);
 void            tracker_indexer_file_move           (TrackerIndexer         *indexer,
 						     const gchar            *module_name,
-						     gchar                  *from,
-						     gchar                  *to,
-						     DBusGMethodInvocation  *context,
-						     GError                **error);
+						     const gchar            *from,
+						     const gchar            *to);
 void            tracker_indexer_volume_disable_all  (TrackerIndexer         *indexer,
 						     DBusGMethodInvocation  *context,
 						     GError                **error);
diff --git a/src/tracker-indexer/tracker-marshal.list b/src/tracker-indexer/tracker-marshal.list
index f17b920..54d16ff 100644
--- a/src/tracker-indexer/tracker-marshal.list
+++ b/src/tracker-indexer/tracker-marshal.list
@@ -1,3 +1,7 @@
 VOID:DOUBLE,UINT,UINT,BOOL
 VOID:DOUBLE,STRING,UINT,UINT,UINT
+VOID:STRING,OBJECT,BOOLEAN
+VOID:STRING,OBJECT,OBJECT,BOOLEAN,BOOLEAN
 VOID:STRING,BOOL
+VOID:STRING,OBJECT
+VOID:STRING,UINT,UINT,UINT,UINT
diff --git a/src/tracker-store/tracker-monitor.c b/src/tracker-indexer/tracker-monitor.c
similarity index 99%
rename from src/tracker-store/tracker-monitor.c
rename to src/tracker-indexer/tracker-monitor.c
index e07e06c..473dc2f 100644
--- a/src/tracker-store/tracker-monitor.c
+++ b/src/tracker-indexer/tracker-monitor.c
@@ -25,6 +25,7 @@
 
 #include <libtracker-common/tracker-dbus.h>
 #include <libtracker-common/tracker-file-utils.h>
+#include <libtracker-common/tracker-status.h>
 #include <libtracker-common/tracker-module-config.h>
 
 #ifdef HAVE_INOTIFY
@@ -36,7 +37,6 @@
 #include "tracker-monitor.h"
 #include "tracker-dbus.h"
 #include "tracker-marshal.h"
-#include "tracker-status.h"
 
 #define TRACKER_MONITOR_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), TRACKER_TYPE_MONITOR, TrackerMonitorPrivate))
 
diff --git a/src/tracker-store/tracker-monitor.h b/src/tracker-indexer/tracker-monitor.h
similarity index 100%
rename from src/tracker-store/tracker-monitor.h
rename to src/tracker-indexer/tracker-monitor.h
diff --git a/src/tracker-store/tracker-processor.c b/src/tracker-indexer/tracker-processor.c
similarity index 91%
rename from src/tracker-store/tracker-processor.c
rename to src/tracker-indexer/tracker-processor.c
index 750a23d..bce1db2 100644
--- a/src/tracker-store/tracker-processor.c
+++ b/src/tracker-indexer/tracker-processor.c
@@ -27,17 +27,15 @@
 #include <libtracker-common/tracker-storage.h>
 #include <libtracker-common/tracker-module-config.h>
 #include <libtracker-common/tracker-utils.h>
+#include <libtracker-common/tracker-status.h>
 
 #include <libtracker-db/tracker-db-manager.h>
 
 #include "tracker-processor.h"
 #include "tracker-crawler.h"
-#include "tracker-daemon.h"
 #include "tracker-dbus.h"
-#include "tracker-indexer-client.h"
-#include "tracker-main.h"
+#include "tracker-indexer.h"
 #include "tracker-monitor.h"
-#include "tracker-status.h"
 
 #define TRACKER_PROCESSOR_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), TRACKER_TYPE_PROCESSOR, TrackerProcessorPrivate))
 
@@ -59,7 +57,7 @@ struct TrackerProcessorPrivate {
 	TrackerStorage *hal;
 	TrackerMonitor *monitor;
 
-	DBusGProxy     *indexer_proxy;
+	TrackerIndexer *indexer;
 
 	/* Crawlers */
 	GHashTable     *crawlers;
@@ -111,14 +109,14 @@ static void tracker_processor_finalize	    (GObject	      *object);
 static void crawler_destroy_notify	    (gpointer	       data);
 static void item_queue_destroy_notify	    (gpointer	       data);
 static void process_module_next		    (TrackerProcessor *processor);
-static void indexer_status_cb		    (DBusGProxy       *proxy,
+static void indexer_status_cb		    (TrackerIndexer   *indexer,
 					     gdouble	       seconds_elapsed,
 					     const gchar      *current_module_name,
 					     guint             items_processed,
 					     guint	       items_indexed,
 					     guint	       items_remaining,
 					     gpointer	       user_data);
-static void indexer_finished_cb		    (DBusGProxy       *proxy,
+static void indexer_finished_cb		    (TrackerIndexer   *indexer,
 					     gdouble	       seconds_elapsed,
 					     guint             items_processed,
 					     guint	       items_indexed,
@@ -298,13 +296,12 @@ tracker_processor_finalize (GObject *object)
 
 	g_list_free (priv->modules);
 
-	dbus_g_proxy_disconnect_signal (priv->indexer_proxy, "Finished",
-					G_CALLBACK (indexer_finished_cb),
-					NULL);
-	dbus_g_proxy_disconnect_signal (priv->indexer_proxy, "Status",
-					G_CALLBACK (indexer_status_cb),
-					NULL);
-	g_object_unref (priv->indexer_proxy);
+	g_signal_handlers_disconnect_by_func (priv->indexer,
+					      G_CALLBACK (indexer_finished_cb),
+					      NULL);
+	g_signal_handlers_disconnect_by_func (priv->indexer,
+					      G_CALLBACK (indexer_status_cb),
+					      NULL);
 
 	g_signal_handlers_disconnect_by_func (priv->monitor,
 					      G_CALLBACK (monitor_item_deleted_cb),
@@ -520,63 +517,9 @@ item_queue_destroy_notify (gpointer data)
 }
 
 static void
-item_queue_readd_items (GQueue *queue,
-			GStrv	strv)
+item_queue_processed_cb (TrackerProcessor *processor)
 {
-	if (queue) {
-		GStrv p;
-		gint  i;
-
-		for (p = strv, i = 0; *p; p++, i++) {
-			g_queue_push_nth (queue, g_file_new_for_path (*p), i);
-		}
-	}
-}
-
-static void
-item_queue_processed_cb (DBusGProxy *proxy,
-			 GError     *error,
-			 gpointer    user_data)
-{
-	TrackerProcessor *processor;
-
-	processor = user_data;
-
-	if (error) {
-		GQueue *queue;
-
-		g_message ("Items could not be processed by the indexer, %s",
-			   error->message);
-		g_error_free (error);
-
-		/* Put files back into queue */
-		switch (processor->private->sent_type) {
-		case SENT_TYPE_CREATED:
-			queue = g_hash_table_lookup (processor->private->items_created_queues,
-						     processor->private->sent_module_name);
-			break;
-		case SENT_TYPE_UPDATED:
-			queue = g_hash_table_lookup (processor->private->items_updated_queues,
-						     processor->private->sent_module_name);
-			break;
-		case SENT_TYPE_DELETED:
-			queue = g_hash_table_lookup (processor->private->items_deleted_queues,
-						     processor->private->sent_module_name);
-			break;
-		case SENT_TYPE_MOVED:
-			queue = g_hash_table_lookup (processor->private->items_moved_queues,
-						     processor->private->sent_module_name);
-			break;
-		case SENT_TYPE_NONE:
-		default:
-			queue = NULL;
-			break;
-		}
-
-		item_queue_readd_items (queue, processor->private->sent_items);
-	} else {
-		g_debug ("Sent!");
-	}
+	g_debug ("Sent!");
 
 	g_strfreev (processor->private->sent_items);
 
@@ -630,11 +573,10 @@ item_queue_handlers_cb (gpointer user_data)
 		processor->private->sent_module_name = module_name;
 		processor->private->sent_items = files;
 
-		org_freedesktop_Tracker_Indexer_files_delete_async (processor->private->indexer_proxy,
-								    module_name,
-								    (const gchar **) files,
-								    item_queue_processed_cb,
-								    processor);
+		tracker_indexer_files_check (processor->private->indexer,
+					     module_name,
+					     files);
+		item_queue_processed_cb (processor);
 
 		return TRUE;
 	}
@@ -658,11 +600,10 @@ item_queue_handlers_cb (gpointer user_data)
 		processor->private->sent_module_name = module_name;
 		processor->private->sent_items = files;
 
-		org_freedesktop_Tracker_Indexer_files_check_async (processor->private->indexer_proxy,
-								   module_name,
-								   (const gchar **) files,
-								   item_queue_processed_cb,
-								   processor);
+		tracker_indexer_files_check (processor->private->indexer,
+					     module_name,
+					     files);
+		item_queue_processed_cb (processor);
 
 		return TRUE;
 	}
@@ -686,11 +627,10 @@ item_queue_handlers_cb (gpointer user_data)
 		processor->private->sent_module_name = module_name;
 		processor->private->sent_items = files;
 
-		org_freedesktop_Tracker_Indexer_files_update_async (processor->private->indexer_proxy,
-								    module_name,
-								    (const gchar **) files,
-								    item_queue_processed_cb,
-								    processor);
+		tracker_indexer_files_check (processor->private->indexer,
+					     module_name,
+					     files);
+		item_queue_processed_cb (processor);
 
 		return TRUE;
 	}
@@ -725,12 +665,11 @@ item_queue_handlers_cb (gpointer user_data)
 		processor->private->sent_module_name = module_name;
 		processor->private->sent_items = files;
 
-		org_freedesktop_Tracker_Indexer_file_move_async (processor->private->indexer_proxy,
-								 module_name,
-								 source,
-								 target,
-								 item_queue_processed_cb,
-								 processor);
+		tracker_indexer_file_move (processor->private->indexer,
+					   module_name,
+					   source,
+					   target);
+		item_queue_processed_cb (processor);
 
 		return TRUE;
 	}
@@ -1078,7 +1017,7 @@ process_module_next (TrackerProcessor *processor)
 }
 
 static void
-indexer_status_cb (DBusGProxy  *proxy,
+indexer_status_cb (TrackerIndexer *indexer,
 		   gdouble	seconds_elapsed,
 		   const gchar *current_module_name,
 		   guint        items_processed,
@@ -1087,9 +1026,6 @@ indexer_status_cb (DBusGProxy  *proxy,
 		   gpointer	user_data)
 {
 	TrackerProcessor *processor;
-	GQueue		 *queue;
-	GFile		 *file;
-	gchar		 *path = NULL;
 	gchar		 *str1;
 	gchar		 *str2;
 
@@ -1106,23 +1042,6 @@ indexer_status_cb (DBusGProxy  *proxy,
 		return;
 	}
 
-	/* Signal to any applications */
-	queue = g_hash_table_lookup (processor->private->items_created_queues, current_module_name);
-	file = g_queue_peek_tail (queue);
-	if (file) {
-		path = g_file_get_path (file);
-	}
-
-	g_signal_emit_by_name (tracker_dbus_get_object (TRACKER_TYPE_DAEMON),
-			       "index-progress",
-			       tracker_module_config_get_index_service (current_module_name),
-			       path ? path : "",
-			       items_processed,
-			       items_remaining,
-			       items_processed + items_remaining,
-			       seconds_elapsed);
-	g_free (path);
-
 	/* Message to the console about state */
 	str1 = tracker_seconds_estimate_to_string (seconds_elapsed,
 						   TRUE,
@@ -1143,7 +1062,7 @@ indexer_status_cb (DBusGProxy  *proxy,
 }
 
 static void
-indexer_finished_cb (DBusGProxy  *proxy,
+indexer_finished_cb (TrackerIndexer *indexer,
 		     gdouble	  seconds_elapsed,
 		     guint        items_processed,
 		     guint	  items_indexed,
@@ -1151,26 +1070,14 @@ indexer_finished_cb (DBusGProxy  *proxy,
 		     gpointer	  user_data)
 {
 	TrackerProcessor *processor;
-	GObject		 *object;
 	gchar		 *str;
 
 	processor = user_data;
-	object = tracker_dbus_get_object (TRACKER_TYPE_DAEMON);
 
 	processor->private->items_done = items_processed;
 	processor->private->items_remaining = 0;
 	processor->private->seconds_elapsed = seconds_elapsed;
 
-	/* Signal to any applications */
-	g_signal_emit_by_name (object,
-			       "index-progress",
-			       "", /* Service */
-			       "", /* Path */
-			       items_processed,
-			       0,
-			       items_processed,
-			       seconds_elapsed);
-
 	/* Message to the console about state */
 	str = tracker_seconds_to_string (seconds_elapsed, FALSE);
 
@@ -1187,11 +1094,6 @@ indexer_finished_cb (DBusGProxy  *proxy,
 	/* Now the indexer is done, we can signal our status as IDLE */
 	tracker_status_set_and_signal (TRACKER_STATUS_IDLE);
 
-	/* Signal to the applet we are finished */
-	g_signal_emit_by_name (object,
-			       "index-finished",
-			       seconds_elapsed);
-
 	/* Signal the processor is now finished */
 	processor->private->finished = TRUE;
 	g_signal_emit (processor, signals[FINISHED], 0);
@@ -1598,12 +1500,12 @@ mount_point_removed_cb (TrackerStorage  *hal,
 
 TrackerProcessor *
 tracker_processor_new (TrackerConfig  *config,
-		       TrackerStorage *hal)
+		       TrackerStorage *hal,
+		       TrackerIndexer *indexer)
 {
 	TrackerProcessor	*processor;
 	TrackerProcessorPrivate *priv;
 	TrackerCrawler		*crawler;
-	DBusGProxy		*proxy;
 	GList			*l;
 
 	g_return_val_if_fail (TRACKER_IS_CONFIG (config), NULL);
@@ -1617,6 +1519,8 @@ tracker_processor_new (TrackerConfig  *config,
 	processor = g_object_new (TRACKER_TYPE_PROCESSOR, NULL);
 	priv = processor->private;
 
+	priv->indexer = indexer;
+
 	/* Set up config */
 	priv->config = g_object_ref (config);
 
@@ -1674,20 +1578,16 @@ tracker_processor_new (TrackerConfig  *config,
 			  G_CALLBACK (monitor_item_moved_cb),
 			  processor);
 
-	/* Set up the indexer proxy and signalling to know when we are
+	/* Set up the indexer and signalling to know when we are
 	 * finished.
 	 */
-	proxy = tracker_dbus_indexer_get_proxy ();
-	priv->indexer_proxy = g_object_ref (proxy);
-
-	dbus_g_proxy_connect_signal (proxy, "Status",
-				     G_CALLBACK (indexer_status_cb),
-				     processor,
-				     NULL);
-	dbus_g_proxy_connect_signal (proxy, "Finished",
-				     G_CALLBACK (indexer_finished_cb),
-				     processor,
-				     NULL);
+
+	g_signal_connect (priv->indexer, "status",
+			  G_CALLBACK (indexer_status_cb),
+			  processor);
+	g_signal_connect (priv->indexer, "finished",
+			  G_CALLBACK (indexer_finished_cb),
+			  processor);
 
 	return processor;
 }
diff --git a/src/tracker-store/tracker-processor.h b/src/tracker-indexer/tracker-processor.h
similarity index 97%
rename from src/tracker-store/tracker-processor.h
rename to src/tracker-indexer/tracker-processor.h
index 45900bd..7b4a8bf 100644
--- a/src/tracker-store/tracker-processor.h
+++ b/src/tracker-indexer/tracker-processor.h
@@ -27,6 +27,8 @@
 #include <libtracker-common/tracker-config.h>
 #include <libtracker-common/tracker-storage.h>
 
+#include "tracker-indexer.h"
+
 G_BEGIN_DECLS
 
 #define TRACKER_TYPE_PROCESSOR	       (tracker_processor_get_type())
@@ -54,7 +56,8 @@ struct TrackerProcessorClass {
 GType		  tracker_processor_get_type		    (void) G_GNUC_CONST;
 
 TrackerProcessor *tracker_processor_new			    (TrackerConfig    *config,
-							     TrackerStorage   *hal);
+							     TrackerStorage   *hal,
+							     TrackerIndexer   *indexer);
 void		  tracker_processor_start		    (TrackerProcessor *processor);
 void		  tracker_processor_stop		    (TrackerProcessor *processor);
 
diff --git a/src/tracker-store/Makefile.am b/src/tracker-store/Makefile.am
index 8005bf1..3435d76 100644
--- a/src/tracker-store/Makefile.am
+++ b/src/tracker-store/Makefile.am
@@ -21,10 +21,6 @@ INCLUDES =								\
 	$(SQLITE3_CFLAGS)						\
 	$(RAPTOR_CFLAGS)
 
-if HAVE_INOTIFY
-inotify_libs = $(top_builddir)/src/libinotify/libinotify.la
-endif
-
 #
 # Daemon sources
 #
@@ -33,27 +29,19 @@ libexec_PROGRAMS = tracker-store
 tracker_store_SOURCES =							\
 	tracker-backup.h						\
 	tracker-backup.c						\
-	tracker-crawler.c						\
-	tracker-crawler.h						\
 	tracker-daemon.c						\
 	tracker-daemon.h						\
 	tracker-dbus.c							\
 	tracker-dbus.h							\
 	tracker-events.c						\
 	tracker-events.h						\
-	tracker-processor.c						\
-	tracker-processor.h						\
 	tracker-main.c							\
 	tracker-main.h							\
 	tracker-marshal-main.c						\
-	tracker-monitor.c						\
-	tracker-monitor.h						\
 	tracker-resources.c						\
 	tracker-resources.h						\
 	tracker-search.c						\
 	tracker-search.h						\
-	tracker-status.c						\
-	tracker-status.h						\
 	tracker-utils.c							\
 	tracker-utils.h							\
 	tracker-volume-cleanup.c					\
@@ -75,9 +63,7 @@ tracker_store_LDADD =							\
 	$(top_builddir)/src/libtracker-db/libtracker-db.la 		\
 	$(top_builddir)/src/libtracker-common/libtracker-common.la 	\
 	$(top_builddir)/src/libstemmer/libstemmer.la	 		\
-	$(inotify_libs)							\
 	$(GMIME_LIBS)							\
-	$(FAM_LIBS)							\
 	$(SQLITE3_LIBS)							\
 	$(DBUS_LIBS)							\
 	$(PANGO_LIBS)							\
diff --git a/src/tracker-store/tracker-daemon.c b/src/tracker-store/tracker-daemon.c
index c20571c..6d32f62 100644
--- a/src/tracker-store/tracker-daemon.c
+++ b/src/tracker-store/tracker-daemon.c
@@ -28,6 +28,7 @@
 #include <libtracker-common/tracker-log.h>
 #include <libtracker-common/tracker-config.h>
 #include <libtracker-common/tracker-dbus.h>
+#include <libtracker-common/tracker-status.h>
 
 #include <libtracker-db/tracker-db-dbus.h>
 #include <libtracker-db/tracker-db-manager.h>
@@ -37,7 +38,6 @@
 #include <libtracker-data/tracker-data-manager.h>
 #include "tracker-indexer-client.h"
 #include "tracker-main.h"
-#include "tracker-status.h"
 #include "tracker-marshal.h"
 
 #define TRACKER_DAEMON_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), TRACKER_TYPE_DAEMON, TrackerDaemonPrivate))
@@ -49,7 +49,6 @@
 
 typedef struct {
 	TrackerConfig	 *config;
-	TrackerProcessor *processor;
 	DBusGProxy	 *indexer_proxy;
 
 	GHashTable       *stats_cache;
@@ -260,28 +259,24 @@ tracker_daemon_finalize (GObject *object)
 
 	g_object_unref (priv->indexer_proxy);
 
-	g_object_unref (priv->processor);
 	g_object_unref (priv->config);
 
 	G_OBJECT_CLASS (tracker_daemon_parent_class)->finalize (object);
 }
 
 TrackerDaemon *
-tracker_daemon_new (TrackerConfig    *config,
-		    TrackerProcessor *processor)
+tracker_daemon_new (TrackerConfig    *config)
 {
 	TrackerDaemon	     *object;
 	TrackerDaemonPrivate *priv;
 
 	g_return_val_if_fail (TRACKER_IS_CONFIG (config), NULL);
-	g_return_val_if_fail (TRACKER_IS_PROCESSOR (processor), NULL);
 
 	object = g_object_new (TRACKER_TYPE_DAEMON, NULL);
 
 	priv = TRACKER_DAEMON_GET_PRIVATE (object);
 
 	priv->config = g_object_ref (config);
-	priv->processor = g_object_ref (processor);
 
 	return object;
 }
@@ -680,30 +675,6 @@ tracker_daemon_prompt_index_signals (TrackerDaemon	    *object,
 	/* Signal state change */
 	tracker_status_signal ();
 
-	/* Signal progress */
-	g_signal_emit_by_name (object,
-			       "index-progress",
-			       "Files",
-			       "",
-			       tracker_processor_get_files_total (priv->processor),
-			       tracker_processor_get_directories_found (priv->processor),
-			       tracker_processor_get_directories_total (priv->processor),
-			       tracker_processor_get_seconds_elapsed (priv->processor));
-
-#if 1
-	/* FIXME: We need a way of knowing WHAT service we have a
-	 * count for, i.e. emails, files, etc.
-	 */
-	g_signal_emit_by_name (object,
-			       "index-progress",
-			       "Emails",
-			       "",
-			       0,  /* priv->tracker->index_count, */
-			       0,  /* priv->tracker->mbox_processed, */
-			       0,  /* priv->tracker->mbox_count); */
-			       0); /* seconds elapsed */
-#endif
-
 	dbus_g_method_return (context);
 
 	tracker_dbus_request_success (request_id);
diff --git a/src/tracker-store/tracker-daemon.h b/src/tracker-store/tracker-daemon.h
index 837fb1c..ea5b72b 100644
--- a/src/tracker-store/tracker-daemon.h
+++ b/src/tracker-store/tracker-daemon.h
@@ -26,8 +26,6 @@
 
 #include <libtracker-common/tracker-config.h>
 
-#include "tracker-processor.h"
-
 #define TRACKER_DAEMON_SERVICE	       "org.freedesktop.Tracker"
 #define TRACKER_DAEMON_PATH	       "/org/freedesktop/Tracker"
 #define TRACKER_DAEMON_INTERFACE       "org.freedesktop.Tracker"
@@ -53,8 +51,7 @@ struct TrackerDaemonClass {
 };
 
 GType	       tracker_daemon_get_type		   (void);
-TrackerDaemon *tracker_daemon_new		   (TrackerConfig	  *config,
-						    TrackerProcessor	  *processor);
+TrackerDaemon *tracker_daemon_new		   (TrackerConfig	  *config);
 void	       tracker_daemon_get_version	   (TrackerDaemon	  *object,
 						    DBusGMethodInvocation *context,
 						    GError **error);
diff --git a/src/tracker-store/tracker-dbus.c b/src/tracker-store/tracker-dbus.c
index afe3a26..bb8cfa8 100644
--- a/src/tracker-store/tracker-dbus.c
+++ b/src/tracker-store/tracker-dbus.c
@@ -26,6 +26,7 @@
 #include <libtracker-common/tracker-log.h>
 #include <libtracker-common/tracker-utils.h>
 #include <libtracker-common/tracker-ontology.h>
+#include <libtracker-common/tracker-status.h>
 
 #include <libtracker-db/tracker-db-dbus.h>
 #include <libtracker-db/tracker-db-manager.h>
@@ -47,7 +48,6 @@
 #include "tracker-indexer-client.h"
 #include "tracker-utils.h"
 #include "tracker-marshal.h"
-#include "tracker-status.h"
 #include "tracker-main.h"
 
 #define TRACKER_INDEXER_SERVICE   "org.freedesktop.Tracker.Indexer"
@@ -232,8 +232,7 @@ tracker_dbus_shutdown (void)
 
 gboolean
 tracker_dbus_register_objects (TrackerConfig	*config,
-			       TrackerLanguage	*language,
-			       TrackerProcessor *processor)
+			       TrackerLanguage	*language)
 {
 	gpointer object, resources;
 	GSList *event_sources = NULL;
@@ -248,7 +247,7 @@ tracker_dbus_register_objects (TrackerConfig	*config,
 	}
 
 	/* Add org.freedesktop.Tracker */
-	object = tracker_daemon_new (config, processor);
+	object = tracker_daemon_new (config);
 	if (!object) {
 		g_critical ("Could not create TrackerDaemon object to register");
 		return FALSE;
diff --git a/src/tracker-store/tracker-dbus.h b/src/tracker-store/tracker-dbus.h
index 0fbf797..0bdff7f 100644
--- a/src/tracker-store/tracker-dbus.h
+++ b/src/tracker-store/tracker-dbus.h
@@ -29,8 +29,6 @@
 #include <libtracker-common/tracker-config.h>
 #include <libtracker-common/tracker-language.h>
 
-#include "tracker-processor.h"
-
 G_BEGIN_DECLS
 
 #define TRACKER_INDEXER_PAUSE_TIME_FOR_REQUESTS 5 /* seconds */
@@ -38,8 +36,7 @@ G_BEGIN_DECLS
 gboolean    tracker_dbus_init                    (TrackerConfig    *config);
 void        tracker_dbus_shutdown                (void);
 gboolean    tracker_dbus_register_objects        (TrackerConfig    *config,
-						  TrackerLanguage  *language,
-						  TrackerProcessor *processor);
+						  TrackerLanguage  *language);
 GObject    *tracker_dbus_get_object              (GType             type);
 void        tracker_dbus_indexer_check_is_paused (void);
 DBusGProxy *tracker_dbus_indexer_get_proxy       (void);
diff --git a/src/tracker-store/tracker-main.c b/src/tracker-store/tracker-main.c
index ea53621..fe885da 100644
--- a/src/tracker-store/tracker-main.c
+++ b/src/tracker-store/tracker-main.c
@@ -52,6 +52,7 @@
 #include <libtracker-common/tracker-module-config.h>
 #include <libtracker-common/tracker-nfs-lock.h>
 #include <libtracker-common/tracker-ontology.h>
+#include <libtracker-common/tracker-status.h>
 #include <libtracker-common/tracker-thumbnailer.h>
 
 #include <libtracker-db/tracker-db-manager.h>
@@ -64,14 +65,10 @@
 
 #include <tracker-push.h>
 
-#include "tracker-crawler.h"
 #include "tracker-dbus.h"
 #include "tracker-events.h"
 #include "tracker-indexer-client.h"
 #include "tracker-main.h"
-#include "tracker-monitor.h"
-#include "tracker-processor.h"
-#include "tracker-status.h"
 #include "tracker-volume-cleanup.h"
 #include "tracker-backup.h"
 #include "tracker-daemon.h"
@@ -113,8 +110,6 @@ typedef struct {
 	
 	gboolean	  reindex_on_shutdown;
 	gboolean          shutdown;
-
-	TrackerProcessor *processor;
 } TrackerMainPrivate;
 
 /* Private */
@@ -193,10 +188,6 @@ private_free (gpointer data)
 
 	private = data;
 
-	if (private->processor) {
-		g_object_unref (private->processor);
-	}
-
 	g_free (private->sys_tmp_dir);
 	g_free (private->user_data_dir);
 	g_free (private->data_dir);
@@ -689,62 +680,6 @@ backup_user_metadata (TrackerConfig *config, TrackerLanguage *language)
 }
 #endif
 
-/*
- * TODO: Ugly hack counting signals because the indexer is sending two "Finished" signals
- *  and only the second really mean "finished processing modules".
- *
- * Saving the last backup file to help with debugging.
- */
-static void
-crawling_finished_cb (TrackerProcessor *processor, 
-		      gpointer          user_data)
-{
-	GError *error = NULL;
-	gulong *callback_id;
-	static gint counter = 0;
-	
-	callback_id = user_data;
-
-	if (++counter >= 2) {
-		gchar *rebackup;
-
-		g_debug ("Uninstalling initial crawling callback");
-		g_signal_handler_disconnect (processor, *callback_id);
-
-		if (g_file_test (get_ttl_backup_filename (), G_FILE_TEST_EXISTS)) {
-			org_freedesktop_Tracker_Indexer_restore_backup (tracker_dbus_indexer_get_proxy (),
-									get_ttl_backup_filename (),
-									&error);
-
-			if (error) {
-				g_message ("Could not restore backup, %s",
-					   error->message);
-				g_error_free (error);
-				return;
-			}
-
-			rebackup = g_strdup_printf ("%s.old",
-						    get_ttl_backup_filename ());
-			g_rename (get_ttl_backup_filename (), rebackup);
-			g_free (rebackup);
-		}
-
-	} else {
-		g_debug ("%d finished signal", counter);
-	}
-}
-
-static void
-backup_restore_on_crawling_finished (TrackerProcessor *processor)
-{
-	static gulong restore_cb_id = 0;
-
-	g_debug ("Setting callback for crawling finish detection");
-	restore_cb_id = g_signal_connect (processor, "finished", 
-					  G_CALLBACK (crawling_finished_cb), 
-					  &restore_cb_id);
-}
-
 #ifdef HAVE_HAL
 
 static void
@@ -800,25 +735,6 @@ set_up_mount_points (TrackerStorage *hal)
 
 #endif /* HAVE_HAL */
 
-static gboolean
-start_cb (gpointer user_data)
-{
-	TrackerMainPrivate *private;
-
-	if (!tracker_status_get_is_ready ()) {
-		return FALSE;
-	}
-
-	private = g_static_private_get (&private_key);
-
-	if (private->processor) {
-		tracker_processor_start (private->processor);
-	}
-
-	return FALSE;
-}
-
-
 static GStrv
 tracker_daemon_get_notifiable_classes (void)
 {
@@ -1041,12 +957,9 @@ main (gint argc, gchar *argv[])
 	set_up_mount_points (hal_storage);
 #endif /* HAVE_HAL */
 
-	private->processor = tracker_processor_new (config, hal_storage);
-
 	/* Make Tracker available for introspection */
 	if (!tracker_dbus_register_objects (config,
-					    language,
-					    private->processor)) {
+					    language)) {
 		return EXIT_FAILURE;
 	}
 
@@ -1060,30 +973,10 @@ main (gint argc, gchar *argv[])
 	 */
 	tracker_status_set_is_ready (TRUE);
 
-	if (!tracker_status_get_is_readonly ()) {
-		gint seconds;
-
-		seconds = tracker_config_get_initial_sleep (config);
-
-		if (seconds > 0) {
-			g_message ("Waiting %d seconds before starting",
-				   seconds);
-			g_timeout_add_seconds (seconds, start_cb, NULL);
-		} else {
-			g_idle_add (start_cb, NULL);
-		}
-	} else {
-		/* We set the state here because it is not set in the
-		 * processor otherwise.
-		 */
-		g_message ("Running in read-only mode, not starting crawler/indexing");
-		tracker_status_set_and_signal (TRACKER_STATUS_IDLE);
-	}
-
-	if (flags & TRACKER_DB_MANAGER_FORCE_REINDEX ||
-	    g_file_test (get_ttl_backup_filename (), G_FILE_TEST_EXISTS)) {
-		backup_restore_on_crawling_finished (private->processor);
-	}
+	/* We set the state here because it is not set in the
+	 * processor otherwise.
+	 */
+	tracker_status_set_and_signal (TRACKER_STATUS_IDLE);
 
 	if (!private->shutdown && tracker_status_get_is_ready ()) {
 		private->main_loop = g_main_loop_new (NULL, FALSE);
@@ -1100,14 +993,6 @@ main (gint argc, gchar *argv[])
 	g_timeout_add_full (G_PRIORITY_LOW, 5000, shutdown_timeout_cb, NULL, NULL);
 
 	g_message ("Cleaning up");
-	if (private->processor) {
-		/* We do this instead of let the private data free
-		 * itself later so we can clean up references to this
-		 * elsewhere.
-		 */
-		g_object_unref (private->processor);
-		private->processor = NULL;
-	}
 
 	shutdown_databases ();
 	shutdown_directories ();
@@ -1161,10 +1046,6 @@ tracker_shutdown (void)
 			tracker_status_set_is_ready (FALSE);
 		}
 
-		if (private->processor) {
-			tracker_processor_stop (private->processor);
-		}
-
 		if (private->main_loop) {
 			g_main_loop_quit (private->main_loop);
 		}
diff --git a/src/tracker-store/tracker-marshal.list b/src/tracker-store/tracker-marshal.list
index a6a9254..81dc924 100644
--- a/src/tracker-store/tracker-marshal.list
+++ b/src/tracker-store/tracker-marshal.list
@@ -1,11 +1,7 @@
-VOID:STRING,UINT,UINT,UINT,UINT
 VOID:STRING,STRING,INT,INT,INT,DOUBLE
 VOID:STRING,BOOLEAN
 VOID:STRING,STRING
 VOID:STRING,BOOLEAN,BOOLEAN,BOOLEAN,BOOLEAN,BOOLEAN,BOOLEAN
-VOID:STRING,OBJECT,BOOLEAN
-VOID:STRING,OBJECT,OBJECT,BOOLEAN,BOOLEAN
-VOID:STRING,OBJECT
 VOID:BOXED
 
 # Indexer signals
diff --git a/src/tracker-store/tracker-resources.c b/src/tracker-store/tracker-resources.c
index 783162d..700ddcc 100644
--- a/src/tracker-store/tracker-resources.c
+++ b/src/tracker-store/tracker-resources.c
@@ -22,6 +22,7 @@
 #include "config.h"
 
 #include <string.h>
+#include <gio/gio.h>
 
 #include <libtracker-common/tracker-dbus.h>
 #include <libtracker-common/tracker-log.h>
diff --git a/tests/tracker-indexer/Makefile.am b/tests/tracker-indexer/Makefile.am
index 50c7dcd..5525a24 100644
--- a/tests/tracker-indexer/Makefile.am
+++ b/tests/tracker-indexer/Makefile.am
@@ -25,9 +25,14 @@ INCLUDES = 									\
 	$(DBUS_CFLAGS)								\
 	$(RAPTOR_CFLAGS)
 
+if HAVE_INOTIFY
+inotify_libs = $(top_builddir)/src/libinotify/libinotify.la
+endif
+
 tracker_metadata_utils_SOURCES = 						\
 	$(top_srcdir)/src/tracker-indexer/tracker-dbus.c			\
 	$(top_srcdir)/src/tracker-store/tracker-events.c			\
+	$(top_srcdir)/src/tracker-indexer/tracker-crawler.c			\
 	$(top_srcdir)/src/tracker-indexer/tracker-indexer.c			\
 	$(top_srcdir)/src/tracker-indexer/tracker-indexer-module.c		\
 	$(top_srcdir)/src/tracker-indexer/tracker-marshal-main.c		\
@@ -36,6 +41,8 @@ tracker_metadata_utils_SOURCES = 						\
 	$(top_srcdir)/src/tracker-indexer/tracker-module-metadata-utils.c 	\
 	$(top_srcdir)/src/tracker-indexer/tracker-module-file.c			\
 	$(top_srcdir)/src/tracker-indexer/tracker-module-iteratable.c		\
+	$(top_srcdir)/src/tracker-indexer/tracker-monitor.c			\
+	$(top_srcdir)/src/tracker-indexer/tracker-processor.c			\
 	$(top_srcdir)/src/tracker-indexer/tracker-removable-device.c		\
 	tracker-metadata-utils-test.c 					
 
@@ -45,6 +52,7 @@ tracker_metadata_utils_LDADD =	                                        	\
 	$(top_builddir)/src/libtracker-common/libtracker-common.la 		\
 	$(top_builddir)/src/libtracker/libtrackerclient- TRACKER_API_VERSION@.la \
 	$(top_builddir)/tests/common/libtracker-testcommon.la           	\
+	$(inotify_libs)							\
 	$(DBUS_LIBS)								\
 	$(PANGO_LIBS)								\
 	$(GMODULE_LIBS)								\



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