tracker r1701 - in branches/xesam-support: . src/libtracker-common src/trackerd



Author: pvanhoof
Date: Tue Jun 17 14:25:37 2008
New Revision: 1701
URL: http://svn.gnome.org/viewvc/tracker?rev=1701&view=rev

Log:
        * svn merge -r 1687:1700 ../indexer-split



Modified:
   branches/xesam-support/ChangeLog
   branches/xesam-support/src/libtracker-common/tracker-dbus.c
   branches/xesam-support/src/trackerd/tracker-crawler.c
   branches/xesam-support/src/trackerd/tracker-monitor.c

Modified: branches/xesam-support/src/libtracker-common/tracker-dbus.c
==============================================================================
--- branches/xesam-support/src/libtracker-common/tracker-dbus.c	(original)
+++ branches/xesam-support/src/libtracker-common/tracker-dbus.c	Tue Jun 17 14:25:37 2008
@@ -90,10 +90,13 @@
 				  gint         max)
 {
 	gchar **strv;
-	gint    i = 0;
+	gchar  *str;
+	gint    i, j;
 	gint    length;
 
-	length = g_async_queue_length (queue);
+	g_async_queue_lock (queue);
+
+	length = g_async_queue_length_unlocked (queue);
 		
 	if (max > 0) {
 		length = MIN (max, length);
@@ -101,26 +104,25 @@
 
 	strv = g_new0 (gchar*, length + 1);
 	
-	while (i <= length) {
-		gchar *str;
-		
-		str = g_async_queue_try_pop (queue);
+	for (i = 0, j = 0; i < length; i++) {
+		str = g_async_queue_try_pop_unlocked (queue);
 
-		if (str) {
-			if (!g_utf8_validate (str, -1, NULL)) {
-				g_message ("Could not add string:'%s' to GStrv, invalid UTF-8", str);
-				g_free (str);
-				continue;
-			}
-
-			strv[i++] = str;
-		} else {
-			/* Queue is empty and we don't expect this */
+		if (!str) {
 			break;
 		}
+
+		if (!g_utf8_validate (str, -1, NULL)) {
+			g_message ("Could not add string:'%s' to GStrv, invalid UTF-8", str);
+			g_free (str);
+			continue;
+		}
+
+		strv[j++] = str;
 	}
 
-        strv[i] = NULL;
+        strv[j] = NULL;
+
+	g_async_queue_unlock (queue);
 
 	return strv;
 }

Modified: branches/xesam-support/src/trackerd/tracker-crawler.c
==============================================================================
--- branches/xesam-support/src/trackerd/tracker-crawler.c	(original)
+++ branches/xesam-support/src/trackerd/tracker-crawler.c	Tue Jun 17 14:25:37 2008
@@ -826,7 +826,7 @@
 {
 	file_enumerators_increment (crawler);
 
-	tracker_monitor_add (file);
+	//tracker_monitor_add (file);
 
 	g_file_enumerate_children_async (file, 
 					 FILE_ATTRIBUTES,					 
@@ -877,16 +877,16 @@
 	}
 
 	g_debug ("File check queue being processed...");
-	files = tracker_dbus_async_queue_to_strv (crawler->priv->files,
-						  FILES_QUEUE_PROCESS_MAX);
+	//files = tracker_dbus_async_queue_to_strv (crawler->priv->files,
+	//					  FILES_QUEUE_PROCESS_MAX);
 	
 	g_debug ("File check queue processed, sending first %d to the indexer", 
 		 g_strv_length (files));
 	
-	org_freedesktop_Tracker_Indexer_check_files_async (proxy, 
-							   (const gchar **) files,
-							   indexer_check_files_cb,
-							   files);
+	//org_freedesktop_Tracker_Indexer_check_files_async (proxy, 
+	//						   (const gchar **) files,
+	//						   indexer_check_files_cb,
+	//						   files);
 
 	g_object_unref (crawler);
 }

Modified: branches/xesam-support/src/trackerd/tracker-monitor.c
==============================================================================
--- branches/xesam-support/src/trackerd/tracker-monitor.c	(original)
+++ branches/xesam-support/src/trackerd/tracker-monitor.c	Tue Jun 17 14:25:37 2008
@@ -27,7 +27,7 @@
 #include "tracker-dbus.h"
 #include "tracker-indexer-client.h"
 
-#define TESTING 
+/* #define TESTING  */
 
 /* This is the default inotify limit - 500 to allow some monitors for
  * other applications. 



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