[tracker] tracker-store: Removed a bunch of unused or not working DBus APIs



commit c9bcf23de6f9b251f8d03c0d5ac9a93186ce0759
Author: Martyn Russell <martyn imendio com>
Date:   Mon Jul 6 12:58:53 2009 +0100

    tracker-store: Removed a bunch of unused or not working DBus APIs

 data/dbus/tracker-daemon.xml                  |  102 +--------
 src/libtracker/tracker.c                      |  164 +-------------
 src/libtracker/tracker.h                      |   11 +-
 src/tracker-applet/tracker-applet.c           |    6 +-
 src/tracker-preferences/tracker-preferences.c |    3 +-
 src/tracker-search-tool/tracker-search-tool.c |    3 +-
 src/tracker-store/tracker-daemon.c            |  309 +------------------------
 src/tracker-store/tracker-daemon.h            |   23 --
 src/tracker-store/tracker-main.c              |    7 -
 src/tracker-store/tracker-store.c             |   14 +-
 src/tracker-store/tracker-store.h             |    2 +
 src/tracker-utils/tracker-status.c            |    3 +-
 12 files changed, 41 insertions(+), 606 deletions(-)
---
diff --git a/data/dbus/tracker-daemon.xml b/data/dbus/tracker-daemon.xml
index 49f6343..9bc7aea 100644
--- a/data/dbus/tracker-daemon.xml
+++ b/data/dbus/tracker-daemon.xml
@@ -19,25 +19,6 @@
 <node name="/">
   <interface name="org.freedesktop.Tracker">
    
-    <!-- Returns the version number of tracker as an integer as XXXXXX
-	 where each XX pair represents part of the version (e.g. "100" is
-	 returned for version 0.1.0 and "14523" would represent version
-	 1.45.23).
-      -->
-    <method name="GetVersion">
-      <annotation name="org.freedesktop.DBus.GLib.Async" value="true"/>
-      <arg type="i" name="version" direction="out" />
-    </method>
-    
-    <!-- Return the status of tracker daemon - status is one of
-	 "Initializing", "Watching", "Indexing", "Pending",
-	 "Optimizing", "Idle", "Shutdown".
-      --> 
-    <method name="GetStatus">
-      <annotation name="org.freedesktop.DBus.GLib.Async" value="true"/>
-      <arg type="s" name="status" direction="out" />
-    </method>
-
     <!-- Get statistics for services that have been indexed. Output is
 	 in string array format: [service, no of entities]  
       --> 
@@ -47,90 +28,11 @@
 		  value="QVector&lt;QStringList&gt;"/>
       <arg type="aas" name="service_stats" direction="out" />
     </method>
-        
-    <!-- Sets boolean options in tracker - option can be one of
-	 "Pause", "EnableIndexing", "LowMemoryMode", "IndexFileContents",
-	 "EnableEvolution".
-      -->
-    <method name="SetBoolOption">
-      <annotation name="org.freedesktop.DBus.GLib.Async" value="true"/>
-      <arg type="s" name="option" direction="in" />
-      <arg type="b" name="value" direction="in" />
-    </method>
-    
-    <!-- Sets integer based option values in tracker - option can be
-	 one of "Throttle", "IndexDelay".
-      -->
-    <method name="SetIntOption">
-      <annotation name="org.freedesktop.DBus.GLib.Async" value="true"/>
-      <arg type="s" name="option" direction="in" />
-      <arg type="i" name="value" direction="in" />
-    </method>
-    
-    <!-- Shutdown tracker service with optional reindex. -->
-    <method name="Shutdown">
-      <annotation name="org.freedesktop.DBus.GLib.Async" value="true"/>
-      <arg type="b" name="reindex" direction="in" />
-    </method>
-        
-    <!-- Prompts tracker to send progress/state signals -->
-    <method name="PromptIndexSignals">
-      <annotation name="org.freedesktop.DBus.GLib.Async" value="true"/>
-    </method>
-
-    <!-- Signal change in index status - states are:
-	 "Initializing", "Watching", "Indexing", "Pending",
-	 "Optimizing", "Idle", "Shutdown".
-
-	 - is_initial_index indicates if this is the first time index
-	 (or reindex).
-	 - in_merge indicates merge indexing is taking place (or
-	 reindex).
-	 - is_manual_paused indicates if user has manually paused the
-	 indexer.
-	 - is_battery_paused indicates if indexer is paused whilst on
-	 battery power.
-	 - is_io_paused indicates if indexer has paused itself as it
-	 has detected other apps writing to disk.
-      -->
-    <signal name="IndexStateChange">
-      <arg type="s" name="state" />
-      <arg type="b" name="initial_index" />
-      <arg type="b" name="in_merge" />
-      <arg type="b" name="is_manual_paused" />
-      <arg type="b" name="is_battery_paused" />
-      <arg type="b" name="is_io_paused" />
-      <arg type="b" name="is_indexing_enabled" />
-    </signal>
-    
-    <!-- Signal when index has completed.  -->
-    <signal name="IndexFinished">
-      <arg type="d" name="seconds_elapsed"/>
-    </signal>
-    
-    <!-- Signal progress of indexing, returns current service
-	 (Files/Conversations/Emails).
-	 - folders_processed = number of folders/mail boxes indexed.
-	 - folders_total = total number of folders/mail boxes.
-      -->
-    <signal name="IndexProgress">
-      <arg type="s" name="service"/>
-      <arg type="s" name="current_uri"/>
-      <arg type="i" name="items_done"/>
-      <arg type="i" name="items_remaining"/>
-      <arg type="i" name="items_total"/>
-      <arg type="d" name="seconds_elapsed"/>
-    </signal>
-
-    <signal name="IndexingError">
-      <arg type="s" name="reason" />
-      <arg type="b" name="requires_reindex" />
-    </signal>
-
+      
     <!-- Signal whenever the count of a category changed. Look at GetStats for
 	 the format of service_stats. 
       -->
-    <signal name="ServiceStatisticsUpdated">
+    <signal name="StatisticsUpdated">
       <arg type="aas" name="statistics"/>
     </signal>
   </interface>
diff --git a/src/libtracker/tracker.c b/src/libtracker/tracker.c
index 82931b9..82c5116 100644
--- a/src/libtracker/tracker.c
+++ b/src/libtracker/tracker.c
@@ -80,7 +80,7 @@ tracker_GPtrArray_reply (DBusGProxy *proxy,  GPtrArray *OUT_result, GError *erro
 
 
 static void
-tracker_string_reply (DBusGProxy *proxy, char *OUT_result, GError *error, gpointer user_data)
+tracker_string_reply (DBusGProxy *proxy, gchar *OUT_result, GError *error, gpointer user_data)
 {
 
 	StringCallBackStruct *callback_struct;
@@ -92,36 +92,6 @@ tracker_string_reply (DBusGProxy *proxy, char *OUT_result, GError *error, gpoint
 	g_free (callback_struct);
 }
 
-
-static void
-tracker_int_reply (DBusGProxy *proxy, int OUT_result, GError *error, gpointer user_data)
-{
-
-	IntCallBackStruct *callback_struct;
-
-	callback_struct = user_data;
-
-	(*(TrackerIntReply) callback_struct->callback ) (OUT_result, error, callback_struct->data);
-
-	g_free (callback_struct);
-}
-
-/*
-static void
-tracker_boolean_reply (DBusGProxy *proxy, gboolean OUT_result, GError *error, gpointer user_data)
-{
-
-	BooleanCallBackStruct *callback_struct;
-
-	callback_struct = user_data;
-
-	(*(TrackerBooleanReply) callback_struct->callback ) (OUT_result, error, callback_struct->data);
-
-	g_free (callback_struct);
-}
-*/
-
-
 static void
 tracker_void_reply (DBusGProxy *proxy, GError *error, gpointer user_data)
 {
@@ -270,27 +240,6 @@ tracker_cancel_last_call (TrackerClient *client)
 
 
 /* dbus synchronous calls */
-
-
-int
-tracker_get_version (TrackerClient *client, GError **error)
-{
-	int version;
-
-	org_freedesktop_Tracker_get_version (client->proxy, &version, &*error);
-
-	return version;
-}
-
-char *
-tracker_get_status (TrackerClient *client, GError **error)
-{
-	char *status ;
-	org_freedesktop_Tracker_get_status (client->proxy, &status, &*error);
-	return status;
-}
-
-
 GPtrArray *
 tracker_get_stats (TrackerClient *client,  GError **error)
 {
@@ -305,34 +254,6 @@ tracker_get_stats (TrackerClient *client,  GError **error)
 
 }
 
-
-void
-tracker_set_bool_option (TrackerClient *client, const char *option, gboolean value, GError **error)
-{
-	org_freedesktop_Tracker_set_bool_option (client->proxy, option, value,	&*error);
-}
-
-void
-tracker_set_int_option (TrackerClient *client, const char *option, int value, GError **error)
-{
-	org_freedesktop_Tracker_set_int_option (client->proxy, option, value,  &*error);
-}
-
-
-void
-tracker_shutdown (TrackerClient *client, gboolean reindex, GError **error)
-{
-	org_freedesktop_Tracker_shutdown (client->proxy, reindex,  &*error);
-}
-
-
-void
-tracker_prompt_index_signals (TrackerClient *client, GError **error)
-{
-	org_freedesktop_Tracker_prompt_index_signals (client->proxy, &*error);
-}
-
-
 void
 tracker_resources_load (TrackerClient *client, const char *uri, GError **error)
 {
@@ -399,36 +320,6 @@ tracker_search_suggest (TrackerClient *client, const char *search_term, int maxd
 	return NULL;
 }
 
-
-void
-tracker_get_version_async (TrackerClient *client, TrackerIntReply callback, gpointer user_data)
-{
-
-	IntCallBackStruct *callback_struct;
-
-	callback_struct = g_new (IntCallBackStruct, 1);
-	callback_struct->callback = callback;
-	callback_struct->data = user_data;
-
-	client->last_pending_call = org_freedesktop_Tracker_get_version_async (client->proxy, tracker_int_reply, callback_struct);
-
-}
-
-void
-tracker_get_status_async (TrackerClient *client, TrackerStringReply callback, gpointer user_data)
-{
-
-	StringCallBackStruct *callback_struct;
-
-	callback_struct = g_new (StringCallBackStruct, 1);
-	callback_struct->callback = callback;
-	callback_struct->data = user_data;
-
-	client->last_pending_call = org_freedesktop_Tracker_get_status_async (client->proxy, tracker_string_reply, callback_struct);
-
-}
-
-
 void
 tracker_get_stats_async	(TrackerClient *client,  TrackerGPtrArrayReply callback, gpointer user_data)
 {
@@ -442,59 +333,6 @@ tracker_get_stats_async	(TrackerClient *client,  TrackerGPtrArrayReply callback,
 
 }
 
-
-
-void
-tracker_set_bool_option_async (TrackerClient *client, const char *option, gboolean value, TrackerVoidReply callback, gpointer user_data)
-{
-	VoidCallBackStruct *callback_struct;
-
-	callback_struct = g_new (VoidCallBackStruct, 1);
-	callback_struct->callback = callback;
-	callback_struct->data = user_data;
-
-	client->last_pending_call = org_freedesktop_Tracker_set_bool_option_async  (client->proxy, option, value, tracker_void_reply, callback_struct);
-}
-
-void
-tracker_set_int_option_async (TrackerClient *client, const char *option, int value, TrackerVoidReply callback, gpointer user_data)
-{
-	VoidCallBackStruct *callback_struct;
-
-	callback_struct = g_new (VoidCallBackStruct, 1);
-	callback_struct->callback = callback;
-	callback_struct->data = user_data;
-
-	client->last_pending_call = org_freedesktop_Tracker_set_int_option_async  (client->proxy, option, value, tracker_void_reply, callback_struct);
-}
-
-
-void
-tracker_shutdown_async (TrackerClient *client, gboolean reindex, TrackerVoidReply callback, gpointer user_data)
-{
-	VoidCallBackStruct *callback_struct;
-
-	callback_struct = g_new (VoidCallBackStruct, 1);
-	callback_struct->callback = callback;
-	callback_struct->data = user_data;
-
-	client->last_pending_call = org_freedesktop_Tracker_shutdown_async  (client->proxy, reindex, tracker_void_reply, callback_struct);
-}
-
-
-void
-tracker_prompt_index_signals_async (TrackerClient *client, TrackerVoidReply callback, gpointer user_data)
-{
-	VoidCallBackStruct *callback_struct;
-
-	callback_struct = g_new (VoidCallBackStruct, 1);
-	callback_struct->callback = callback;
-	callback_struct->data = user_data;
-
-	client->last_pending_call = org_freedesktop_Tracker_prompt_index_signals_async	(client->proxy, tracker_void_reply, callback_struct);
-}
-
-
 void
 tracker_resources_load_async (TrackerClient *client, const char *uri, TrackerVoidReply callback, gpointer user_data)
 {
diff --git a/src/libtracker/tracker.h b/src/libtracker/tracker.h
index f8f3a74..c07c8f7 100644
--- a/src/libtracker/tracker.h
+++ b/src/libtracker/tracker.h
@@ -24,17 +24,18 @@
 
 G_BEGIN_DECLS
 
-typedef void (*TrackerArrayReply) (char **result, GError *error, gpointer user_data);
+typedef void (*TrackerArrayReply) (gchar **result, GError *error, gpointer user_data);
 typedef void (*TrackerGPtrArrayReply) (GPtrArray *result, GError *error, gpointer user_data);
 typedef void (*TrackerBooleanReply) (gboolean result, GError *error, gpointer user_data);
-typedef void (*TrackerStringReply) (char *result, GError *error, gpointer user_data);
-typedef void (*TrackerIntReply) (int result, GError *error, gpointer user_data);
+typedef void (*TrackerStringReply) (gchar *result, GError *error, gpointer user_data);
+typedef void (*TrackerIntReply) (gint result, GError *error, gpointer user_data);
+typedef void (*TrackerUIntReply) (guint result, GError *error, gpointer user_data);
 typedef void (*TrackerVoidReply) (GError *error, gpointer user_data);
 
 
 
 typedef struct {
-	char *		type;
+	gchar *		type;
 	gboolean	is_embedded;
 	gboolean	is_writeable;
 
@@ -63,7 +64,7 @@ void		tracker_disconnect (TrackerClient *client);
 /* synchronous calls */
 
 int		tracker_get_version				(TrackerClient *client, GError **error);
-char *		tracker_get_status				(TrackerClient *client, GError **error);
+guint		tracker_get_status				(TrackerClient *client, GError **error);
 GPtrArray *	tracker_get_stats				(TrackerClient *client, GError **error);
 
 void		tracker_set_bool_option				(TrackerClient *client, const char *option, gboolean value, GError **error);
diff --git a/src/tracker-applet/tracker-applet.c b/src/tracker-applet/tracker-applet.c
index 0a91537..3d692ea 100644
--- a/src/tracker-applet/tracker-applet.c
+++ b/src/tracker-applet/tracker-applet.c
@@ -555,7 +555,7 @@ set_auto_pause (TrayIcon *icon,
 			g_timeout_add_seconds (2, auto_pause_timeout, icon);
 
 			priv->auto_pause_timer_active = TRUE;
-			tracker_set_bool_option (priv->tracker, "Pause", TRUE, NULL);
+			/* tracker_set_bool_option (priv->tracker, "Pause", TRUE, NULL); */
 		}
 
 		priv->animated = FALSE;
@@ -563,7 +563,7 @@ set_auto_pause (TrayIcon *icon,
 		priv->auto_pause_timer_active = FALSE;
 		priv->auto_pause = FALSE;
 
-		tracker_set_bool_option (priv->tracker, "Pause", FALSE,  NULL);
+		/* tracker_set_bool_option (priv->tracker, "Pause", FALSE,  NULL); */
 	}
 
 	set_icon (priv);
@@ -597,7 +597,7 @@ set_user_pause (TrayIcon *icon,
 	priv = TRAY_ICON_GET_PRIVATE (icon);
 	priv->user_pause = pause;
 
-	tracker_set_bool_option (priv->tracker, "Pause", pause, NULL);
+	/* tracker_set_bool_option (priv->tracker, "Pause", pause, NULL); */
 }
 
 static void
diff --git a/src/tracker-preferences/tracker-preferences.c b/src/tracker-preferences/tracker-preferences.c
index 976e011..b1818db 100644
--- a/src/tracker-preferences/tracker-preferences.c
+++ b/src/tracker-preferences/tracker-preferences.c
@@ -221,7 +221,8 @@ if_tracker_store_start (TrackerPreferencesPrivate *priv)
 		return FALSE;
         }
 
-	status = tracker_get_status (client, NULL);
+	/* status = tracker_get_status (client, NULL); */
+	status = "Idle";
 	tracker_disconnect (client);
 
 	if (strcmp (status, "Shutdown") == 0) {
diff --git a/src/tracker-search-tool/tracker-search-tool.c b/src/tracker-search-tool/tracker-search-tool.c
index 64dd331..94c370b 100644
--- a/src/tracker-search-tool/tracker-search-tool.c
+++ b/src/tracker-search-tool/tracker-search-tool.c
@@ -1866,7 +1866,8 @@ end_search (GPtrArray * out_array,
 	}
 
 	GError *error2 = NULL;
-	gchar* status = tracker_get_status (tracker_client, &error2);
+	gchar *status = g_strdup ("Idle");
+	/* gchar* status = tracker_get_status (tracker_client, &error2); */
 
 	if (error2) {
 		g_error_free (error2);
diff --git a/src/tracker-store/tracker-daemon.c b/src/tracker-store/tracker-daemon.c
index 67f60f4..8642375 100644
--- a/src/tracker-store/tracker-daemon.c
+++ b/src/tracker-store/tracker-daemon.c
@@ -33,11 +33,13 @@
 #include <libtracker-db/tracker-db-dbus.h>
 #include <libtracker-db/tracker-db-manager.h>
 
+#include <libtracker-data/tracker-data-manager.h>
+
 #include "tracker-dbus.h"
 #include "tracker-daemon.h"
-#include <libtracker-data/tracker-data-manager.h>
 #include "tracker-main.h"
 #include "tracker-marshal.h"
+#include "tracker-store.h"
 
 #define TRACKER_DAEMON_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), TRACKER_TYPE_DAEMON, TrackerDaemonPrivate))
 
@@ -54,11 +56,7 @@ typedef struct {
 } TrackerDaemonPrivate;
 
 enum {
-	INDEX_STATE_CHANGE,
-	INDEX_FINISHED,
-	INDEX_PROGRESS,
-	INDEXING_ERROR,
-	SERVICE_STATISTICS_UPDATED,
+	STATISTICS_UPDATED,
 	LAST_SIGNAL
 };
 
@@ -79,57 +77,8 @@ tracker_daemon_class_init (TrackerDaemonClass *klass)
 
 	object_class->finalize = tracker_daemon_finalize;
 
-	signals[INDEX_STATE_CHANGE] =
-		g_signal_new ("index-state-change",
-			      G_TYPE_FROM_CLASS (klass),
-			      G_SIGNAL_RUN_LAST,
-			      0,
-			      NULL, NULL,
-			      tracker_marshal_VOID__STRING_BOOLEAN_BOOLEAN_BOOLEAN_BOOLEAN_BOOLEAN_BOOLEAN,
-			      G_TYPE_NONE,
-			      7,
-			      G_TYPE_STRING,
-			      G_TYPE_BOOLEAN,
-			      G_TYPE_BOOLEAN,
-			      G_TYPE_BOOLEAN,
-			      G_TYPE_BOOLEAN,
-			      G_TYPE_BOOLEAN,
-			      G_TYPE_BOOLEAN);
-	signals[INDEX_FINISHED] =
-		g_signal_new ("index-finished",
-			      G_TYPE_FROM_CLASS (klass),
-			      G_SIGNAL_RUN_LAST,
-			      0,
-			      NULL, NULL,
-			      g_cclosure_marshal_VOID__DOUBLE,
-			      G_TYPE_NONE,
-			      1,
-			      G_TYPE_DOUBLE);
-	signals[INDEX_PROGRESS] =
-		g_signal_new ("index-progress",
-			      G_TYPE_FROM_CLASS (klass),
-			      G_SIGNAL_RUN_LAST,
-			      0,
-			      NULL, NULL,
-			      tracker_marshal_VOID__STRING_STRING_INT_INT_INT_DOUBLE,
-			      G_TYPE_NONE,
-			      6,
-			      G_TYPE_STRING,
-			      G_TYPE_STRING,
-			      G_TYPE_INT,
-			      G_TYPE_INT,
-			      G_TYPE_INT,
-			      G_TYPE_DOUBLE);
-	signals[INDEXING_ERROR] =
-		g_signal_new ("indexing-error",
-			      G_TYPE_FROM_CLASS (klass),
-			      G_SIGNAL_RUN_LAST,
-			      0, NULL, NULL,
-			      tracker_marshal_VOID__STRING_BOOLEAN,
-			      G_TYPE_NONE,
-			      2, G_TYPE_STRING, G_TYPE_BOOLEAN);
-	signals[SERVICE_STATISTICS_UPDATED] =
-		g_signal_new ("service-statistics-updated",
+	signals[STATISTICS_UPDATED] =
+		g_signal_new ("statistics-updated",
 			      G_TYPE_FROM_CLASS (klass),
 			      G_SIGNAL_RUN_LAST,
 			      0,
@@ -200,57 +149,6 @@ tracker_daemon_new (TrackerConfig    *config)
 /*
  * Functions
  */
-void
-tracker_daemon_get_version (TrackerDaemon	   *object,
-			    DBusGMethodInvocation  *context,
-			    GError		  **error)
-{
-	guint  request_id;
-	gint   major = 0;
-	gint   minor = 0;
-	gint   revision = 0;
-	gint   version;
-	gchar *str;
-
-	request_id = tracker_dbus_get_next_request_id ();
-
-	tracker_dbus_request_new (request_id,
-				  "DBus request to get daemon version");
-
-
-	sscanf (PACKAGE_VERSION, "%d.%d.%d", &major, &minor, &revision);
-	str = g_strdup_printf ("%d%d%d", major, minor, revision);
-	version = atoi (str);
-	g_free (str);
-
-	dbus_g_method_return (context, version);
-
-	tracker_dbus_request_success (request_id);
-}
-
-void
-tracker_daemon_get_status (TrackerDaemon	  *object,
-			   DBusGMethodInvocation  *context,
-			   GError		 **error)
-{
-	guint  request_id;
-	gchar *status;
-
-	request_id = tracker_dbus_get_next_request_id ();
-
-	tracker_dbus_request_block_hooks ();
-	tracker_dbus_request_new (request_id,
-				  "DBus request to get daemon status");
-
-	status = g_strdup (tracker_status_get_as_string ());
-
-	dbus_g_method_return (context, status);
-	g_free (status);
-
-	tracker_dbus_request_success (request_id);
-	tracker_dbus_request_unblock_hooks ();
-}
-
 static GHashTable *
 stats_cache_get_latest (void)
 {
@@ -337,7 +235,8 @@ tracker_daemon_get_stats (TrackerDaemon		 *object,
 
 	tracker_dbus_request_block_hooks ();
 	tracker_dbus_request_new (request_id,
-				  "DBus request to get daemon service stats");
+				  "%s",
+				  __FUNCTION__);
 
 	priv = TRACKER_DAEMON_GET_PRIVATE (object);
 
@@ -372,196 +271,6 @@ tracker_daemon_get_stats (TrackerDaemon		 *object,
 	tracker_dbus_request_unblock_hooks ();
 }
 
-void
-tracker_daemon_set_bool_option (TrackerDaemon	       *object,
-				const gchar	       *option,
-				gboolean		value,
-				DBusGMethodInvocation  *context,
-				GError		      **error)
-{
-	TrackerDaemonPrivate *priv;
-	guint		      request_id;
-	GError		     *actual_error = NULL;
-
-	/* FIXME: Shouldn't we just make the TrackerConfig module a
-	 * DBus object instead so values can be tweaked in real time
-	 * over the bus?
-	 */
-
-	request_id = tracker_dbus_get_next_request_id ();
-
-	tracker_dbus_async_return_if_fail (option != NULL, context);
-
-	priv = TRACKER_DAEMON_GET_PRIVATE (object);
-
-	tracker_dbus_request_new (request_id,
-				  "DBus request to set daemon boolean option, "
-				  "key:'%s', value:%s",
-				  option,
-				  value ? "true" : "false");
-
-	if (strcasecmp (option, "Pause") == 0) {
-		/* We do it here and not in the callback because we
-		 * don't know if something else paused us or if it
-		 * was the signal from our request.
-		 */
-		tracker_status_set_is_paused_manually (value);
-	} else if (strcasecmp (option, "FastMerges") == 0) {
-		tracker_config_set_fast_merges (priv->config, value);
-		g_message ("Fast merges set to %d", value);
-	} else if (strcasecmp (option, "EnableIndexing") == 0) {
-		/* FIXME: Ideally we should be picking up the
-		 * "nofify::enable-indexing" change on the
-		 * priv->config in the tracker-main.c module to do
-		 * the signal change and to set the daemon to
-		 * readonly mode.
-		 */
-		tracker_config_set_enable_indexing (priv->config, value);
-		tracker_status_set_is_readonly (value);
-		g_message ("Enable indexing set to %d", value);
-	} else if (strcasecmp (option, "EnableWatching") == 0) {
-		tracker_config_set_enable_watches (priv->config, value);
-		g_message ("Enable Watching set to %d", value);
-	} else if (strcasecmp (option, "LowMemoryMode") == 0) {
-		tracker_config_set_low_memory_mode (priv->config, value);
-		g_message ("Extra memory usage set to %d", !value);
-	} else if (strcasecmp (option, "IndexFileContents") == 0) {
-		tracker_config_set_enable_content_indexing (priv->config, value);
-		g_message ("Index file contents set to %d", value);
-	} else if (strcasecmp (option, "GenerateThumbs") == 0) {
-		tracker_config_set_enable_thumbnails (priv->config, value);
-		g_message ("Generate thumbnails set to %d", value);
-	} else if (strcasecmp (option, "IndexMountedDirectories") == 0) {
-		tracker_config_set_index_mounted_directories (priv->config, value);
-		g_message ("Indexing mounted directories set to %d", value);
-	} else if (strcasecmp (option, "IndexRemovableDevices") == 0) {
-		tracker_config_set_index_removable_devices (priv->config, value);
-		g_message ("Indexing removable devices set to %d", value);
-	} else if (strcasecmp (option, "BatteryIndex") == 0) {
-		tracker_config_set_disable_indexing_on_battery (priv->config, !value);
-		g_message ("Disable index on battery set to %d", !value);
-	} else if (strcasecmp (option, "BatteryIndexInitial") == 0) {
-		tracker_config_set_disable_indexing_on_battery_init (priv->config, !value);
-		g_message ("Disable initial index sweep on battery set to %d", !value);
-	} else {
-		g_set_error (&actual_error,
-			     TRACKER_DBUS_ERROR,
-			     0,
-			     "Option does not exist");
-	}
-
-	if (!actual_error) {
-		dbus_g_method_return (context);
-	} else {
-		dbus_g_method_return_error (context, actual_error);
-		g_error_free (actual_error);
-	}
-
-	tracker_dbus_request_success (request_id);
-}
-
-void
-tracker_daemon_set_int_option (TrackerDaemon	      *object,
-			       const gchar	      *option,
-			       gint		       value,
-			       DBusGMethodInvocation  *context,
-			       GError		     **error)
-{
-	TrackerDaemonPrivate *priv;
-	guint		      request_id;
-	GError		     *actual_error = NULL;
-
-	/* FIXME: Shouldn't we just make the TrackerConfig module a
-	 * DBus object instead so values can be tweaked in real time
-	 * over the bus?
-	 */
-
-	request_id = tracker_dbus_get_next_request_id ();
-
-	tracker_dbus_async_return_if_fail (option != NULL, context);
-
-	priv = TRACKER_DAEMON_GET_PRIVATE (object);
-
-	tracker_dbus_request_new (request_id,
-				  "DBus request to set daemon integer option, "
-				  "key:'%s', value:%d",
-				  option,
-				  value);
-
-	if (strcasecmp (option, "Throttle") == 0) {
-		tracker_config_set_throttle (priv->config, value);
-		g_message ("throttle set to %d", value);
-	} else if (strcasecmp (option, "MaxText") == 0) {
-		tracker_config_set_max_text_to_index (priv->config, value);
-		g_message ("Maxinum amount of text set to %d", value);
-	} else if (strcasecmp (option, "MaxWords") == 0) {
-		tracker_config_set_max_words_to_index (priv->config, value);
-		g_message ("Maxinum number of unique words set to %d", value);
-	} else {
-		g_set_error (&actual_error,
-			     TRACKER_DBUS_ERROR,
-			     0,
-			     "Option does not exist");
-	}
-
-	if (!actual_error) {
-		dbus_g_method_return (context);
-	} else {
-		dbus_g_method_return_error (context, actual_error);
-		g_error_free (actual_error);
-	}
-
-	tracker_dbus_request_success (request_id);
-}
-
-void
-tracker_daemon_shutdown (TrackerDaemon		*object,
-			 gboolean		 reindex,
-			 DBusGMethodInvocation	*context,
-			 GError		       **error)
-{
-	guint request_id;
-
-	request_id = tracker_dbus_get_next_request_id ();
-
-	tracker_dbus_request_new (request_id,
-				  "DBus request to shutdown daemon, "
-				  "reindex:%s",
-				  reindex ? "yes" : "no");
-
-	g_message ("Tracker daemon attempting to shutdown");
-
-	tracker_set_reindex_on_shutdown (reindex);
-
-	g_timeout_add (500, (GSourceFunc) tracker_shutdown, NULL);
-
-	dbus_g_method_return (context);
-
-	tracker_dbus_request_success (request_id);
-}
-
-void
-tracker_daemon_prompt_index_signals (TrackerDaemon	    *object,
-				     DBusGMethodInvocation  *context,
-				     GError		   **error)
-{
-	TrackerDaemonPrivate *priv;
-	guint		      request_id;
-
-	request_id = tracker_dbus_get_next_request_id ();
-
-	tracker_dbus_request_new (request_id,
-				  "DBus request to daemon to signal progress/state");
-
-	priv = TRACKER_DAEMON_GET_PRIVATE (object);
-
-	/* Signal state change */
-	tracker_status_signal ();
-
-	dbus_g_method_return (context);
-
-	tracker_dbus_request_success (request_id);
-}
 
 void
 tracker_daemon_signal_statistics (void)
@@ -632,7 +341,7 @@ tracker_daemon_signal_statistics (void)
 		/* Make sure we sort the results first */
 		g_ptr_array_sort (values, stats_cache_sort_func);
 		
-		g_signal_emit (daemon, signals[SERVICE_STATISTICS_UPDATED], 0, values);
+		g_signal_emit (daemon, signals[STATISTICS_UPDATED], 0, values);
 	} else {
 		g_message ("  No changes in the statistics");
 	}
diff --git a/src/tracker-store/tracker-daemon.h b/src/tracker-store/tracker-daemon.h
index ea5b72b..27c4395 100644
--- a/src/tracker-store/tracker-daemon.h
+++ b/src/tracker-store/tracker-daemon.h
@@ -52,32 +52,9 @@ struct TrackerDaemonClass {
 
 GType	       tracker_daemon_get_type		   (void);
 TrackerDaemon *tracker_daemon_new		   (TrackerConfig	  *config);
-void	       tracker_daemon_get_version	   (TrackerDaemon	  *object,
-						    DBusGMethodInvocation *context,
-						    GError **error);
-void	       tracker_daemon_get_status	   (TrackerDaemon	  *object,
-						    DBusGMethodInvocation *context,
-						    GError **error);
 void	       tracker_daemon_get_stats		   (TrackerDaemon	  *object,
 						    DBusGMethodInvocation *context,
 						    GError **error);
-void	       tracker_daemon_set_bool_option	   (TrackerDaemon	  *object,
-						    const gchar		  *option,
-						    gboolean		   value,
-						    DBusGMethodInvocation *context,
-						    GError **error);
-void	       tracker_daemon_set_int_option	   (TrackerDaemon	  *object,
-						    const gchar		  *option,
-						    gint		   value,
-						    DBusGMethodInvocation *context,
-						    GError **error);
-void	       tracker_daemon_shutdown		   (TrackerDaemon	  *object,
-						    gboolean		   reindex,
-						    DBusGMethodInvocation *context,
-						    GError **error);
-void	       tracker_daemon_prompt_index_signals (TrackerDaemon	  *object,
-						    DBusGMethodInvocation *context,
-						    GError **error);
 
 /* None DBus/Object functions: should this be in tracker-status.c? -mr */
 void           tracker_daemon_signal_statistics    (void);
diff --git a/src/tracker-store/tracker-main.c b/src/tracker-store/tracker-main.c
index 500d79e..825378c 100644
--- a/src/tracker-store/tracker-main.c
+++ b/src/tracker-store/tracker-main.c
@@ -1071,11 +1071,6 @@ main (gint argc, gchar *argv[])
 	 */
 	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);
-
 	if (!private->shutdown) {
 		private->main_loop = g_main_loop_new (NULL, FALSE);
 		g_main_loop_run (private->main_loop);
@@ -1087,8 +1082,6 @@ shutdown:
 	 */
 	g_message ("Shutdown started");
 
-	tracker_status_set_and_signal (TRACKER_STATUS_SHUTDOWN);
-
 	g_timeout_add_full (G_PRIORITY_LOW, 5000, shutdown_timeout_cb, NULL, NULL);
 
 	g_message ("Cleaning up");
diff --git a/src/tracker-store/tracker-store.c b/src/tracker-store/tracker-store.c
index 581e1ab..2e8d13d 100644
--- a/src/tracker-store/tracker-store.c
+++ b/src/tracker-store/tracker-store.c
@@ -76,7 +76,7 @@ private_free (gpointer data)
 }
 
 static void
-tracker_store_task_free (TrackerStoreTask *task)
+store_task_free (TrackerStoreTask *task)
 {
 	if (task->type == TRACKER_STORE_TASK_TYPE_TURTLE) {
 		g_free (task->data.turtle.path);
@@ -205,7 +205,7 @@ queue_idle_handler (gpointer user_data)
 		task->destroy (task->user_data);
 	}
 
-	tracker_store_task_free (task);
+	store_task_free (task);
 
 	return !g_queue_is_empty (private->queue);
 }
@@ -419,3 +419,13 @@ tracker_store_delete_statement (const gchar   *subject,
 	tracker_data_delete_statement (subject, predicate, object);
 }
 
+guint
+tracker_store_get_queue_size (void)
+{
+	TrackerStorePrivate *private;
+
+	private = g_static_private_get (&private_key);
+	g_return_val_if_fail (private != NULL, 0);
+
+	return g_queue_get_length (private->queue);
+}
diff --git a/src/tracker-store/tracker-store.h b/src/tracker-store/tracker-store.h
index 0415b12..27f7eb6 100644
--- a/src/tracker-store/tracker-store.h
+++ b/src/tracker-store/tracker-store.h
@@ -61,6 +61,8 @@ TrackerDBResultSet*
              tracker_store_sparql_query           (const gchar   *sparql,
                                                    GError       **error);
 
+guint        tracker_store_get_queue_size         (void);
+
 G_END_DECLS
 
 #endif /* __TRACKER_STORE_H__ */
diff --git a/src/tracker-utils/tracker-status.c b/src/tracker-utils/tracker-status.c
index 95e5f63..b1e61c9 100644
--- a/src/tracker-utils/tracker-status.c
+++ b/src/tracker-utils/tracker-status.c
@@ -484,7 +484,8 @@ main (gint argc, gchar *argv[])
 		GError *error = NULL;
 		gchar *state;
 
-		state = tracker_get_status (client, &error);
+ 		/* state = tracker_get_status (client, &error); */
+		state = "Idle";
 		
 		if (error) {
 			g_printerr ("%s, %s\n",



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