tracker r1909 - in branches/indexer-split: . src/trackerd



Author: pvanhoof
Date: Tue Jul 22 16:56:08 2008
New Revision: 1909
URL: http://svn.gnome.org/viewvc/tracker?rev=1909&view=rev

Log:
2008-07-22  Philip Van Hoof  <pvanhoof gnome org>

        * src/trackerd/tracker-dbus.c:
        * src/trackerd/tracker-indexer.c:
        * src/trackerd/tracker-dbus.h:
        * src/trackerd/tracker-indexer.h:

        Moving some code around



Modified:
   branches/indexer-split/ChangeLog
   branches/indexer-split/src/trackerd/tracker-dbus.c
   branches/indexer-split/src/trackerd/tracker-dbus.h
   branches/indexer-split/src/trackerd/tracker-indexer.c
   branches/indexer-split/src/trackerd/tracker-indexer.h

Modified: branches/indexer-split/src/trackerd/tracker-dbus.c
==============================================================================
--- branches/indexer-split/src/trackerd/tracker-dbus.c	(original)
+++ branches/indexer-split/src/trackerd/tracker-dbus.c	Tue Jul 22 16:56:08 2008
@@ -42,6 +42,7 @@
 #include "tracker-indexer-client.h"
 #include "tracker-utils.h"
 #include "tracker-marshal.h"
+#include "tracker-status.h"
 
 static DBusGConnection *connection;
 static DBusGProxy      *proxy;
@@ -392,3 +393,72 @@
 
 	return proxy_for_indexer;
 }
+
+
+
+static guint pause_timeout = 0;
+
+static void 
+set_paused_reply (DBusGProxy *proxy, GError *error, gpointer userdata)
+{
+}
+
+static gboolean
+tracker_indexer_pauzed (gpointer user_data)
+{
+	DBusGProxy *proxy = user_data;
+
+	/* Here it doesn't matter, so we don't block like below */
+	org_freedesktop_Tracker_Indexer_set_paused_async (proxy, FALSE, 
+							  set_paused_reply,
+							  NULL);
+
+	return FALSE;
+}
+
+static void
+tracker_indexer_pauze_finished (gpointer user_data)
+{
+	DBusGProxy *proxy = user_data;
+	pause_timeout = 0;
+	g_object_unref (proxy);
+}
+
+void
+tracker_indexer_pause (void)
+{
+	/* If we are not indexing, there's no indexer to pauze ... 
+	 * Q: what if during this pause an indexer gets started? */
+
+	if (tracker_status_get () != TRACKER_STATUS_INDEXING)
+		return;
+
+	/* If another pause is already active */
+	if (pause_timeout == 0) {
+		DBusGProxy *proxy;
+		GError     *error = NULL;
+
+		proxy = tracker_dbus_indexer_get_proxy ();
+
+		/* We want to block until we are sure that we are pauzed */
+		org_freedesktop_Tracker_Indexer_set_paused (proxy, TRUE, &error);
+
+		if (!error) {
+			/* Activate a pause */
+			pause_timeout = g_timeout_add_full (G_PRIORITY_DEFAULT,
+							    10 * 1000 /* 10 seconds */,
+							    tracker_indexer_pauzed,
+							    g_object_ref (proxy),
+							    tracker_indexer_pauze_finished);
+		} else {
+			/* Should we do something useful with error here? */
+			g_error_free (error);
+		}
+	}
+}
+
+void
+tracker_indexer_continue (void)
+{
+	return;
+}

Modified: branches/indexer-split/src/trackerd/tracker-dbus.h
==============================================================================
--- branches/indexer-split/src/trackerd/tracker-dbus.h	(original)
+++ branches/indexer-split/src/trackerd/tracker-dbus.h	Tue Jul 22 16:56:08 2008
@@ -44,6 +44,9 @@
 GObject    *tracker_dbus_get_object        (GType             type);
 DBusGProxy *tracker_dbus_indexer_get_proxy (void);
 
+void        tracker_indexer_pause          (void);
+void        tracker_indexer_continue       (void);
+
 G_END_DECLS
 
 #endif /* __TRACKERD_DBUS_H__ */

Modified: branches/indexer-split/src/trackerd/tracker-indexer.c
==============================================================================
--- branches/indexer-split/src/trackerd/tracker-indexer.c	(original)
+++ branches/indexer-split/src/trackerd/tracker-indexer.c	Tue Jul 22 16:56:08 2008
@@ -37,9 +37,6 @@
 #include "tracker-indexer.h"
 #include "tracker-query-tree.h"
 #include "tracker-indexer-client.h"
-#include "tracker-status.h"
-#include "tracker-indexer-client.h"
-#include "tracker-dbus.h"
 
 /* Size of free block pool of inverted index */
 #define MAX_HIT_BUFFER      480000
@@ -665,70 +662,3 @@
 	return FALSE;
 }
 
-
-static guint pause_timeout = 0;
-
-static void 
-set_paused_reply (DBusGProxy *proxy, GError *error, gpointer userdata)
-{
-}
-
-static gboolean
-tracker_indexer_pauzed (gpointer user_data)
-{
-	DBusGProxy *proxy = user_data;
-
-	/* Here it doesn't matter, so we don't block like below */
-	org_freedesktop_Tracker_Indexer_set_paused_async (proxy, FALSE, 
-							  set_paused_reply,
-							  NULL);
-
-	return FALSE;
-}
-
-static void
-tracker_indexer_pauze_finished (gpointer user_data)
-{
-	DBusGProxy *proxy = user_data;
-	pause_timeout = 0;
-	g_object_unref (proxy);
-}
-
-void
-tracker_indexer_pause (void)
-{
-	/* If we are not indexing, there's no indexer to pauze ... 
-	 * Q: what if during this pause an indexer gets started? */
-
-	if (tracker_status_get () != TRACKER_STATUS_INDEXING)
-		return;
-
-	/* If another pause is already active */
-	if (pause_timeout == 0) {
-		DBusGProxy *proxy;
-		GError     *error = NULL;
-
-		proxy = tracker_dbus_indexer_get_proxy ();
-
-		/* We want to block until we are sure that we are pauzed */
-		org_freedesktop_Tracker_Indexer_set_paused (proxy, TRUE, &error);
-
-		if (!error) {
-			/* Activate a pause */
-			pause_timeout = g_timeout_add_full (G_PRIORITY_DEFAULT,
-							    10 * 1000 /* 10 seconds */,
-							    tracker_indexer_pauzed,
-							    g_object_ref (proxy),
-							    tracker_indexer_pauze_finished);
-		} else {
-			/* Should we do something useful with error here? */
-			g_error_free (error);
-		}
-	}
-}
-
-void
-tracker_indexer_continue (void)
-{
-	return;
-}

Modified: branches/indexer-split/src/trackerd/tracker-indexer.h
==============================================================================
--- branches/indexer-split/src/trackerd/tracker-indexer.h	(original)
+++ branches/indexer-split/src/trackerd/tracker-indexer.h	Tue Jul 22 16:56:08 2008
@@ -71,9 +71,6 @@
 									  const gchar               *word,
 									  GSList                    *dud_list);
 
-void                       tracker_indexer_pause                          (void);
-void                       tracker_indexer_continue                       (void);
-
 G_END_DECLS
 
 #endif /* __TRACKERD_INDEXER_H__ */



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