[tracker/needle: 38/53] tracker-needle: Use cursor.next_async() to give Spinner some cpu time



commit 6d2519ba134c017fdc51f452bf423147a9278cae
Author: Martyn Russell <martyn lanedo com>
Date:   Fri Sep 10 11:30:26 2010 +0100

    tracker-needle: Use cursor.next_async() to give Spinner some cpu time
    
    This currently causes a crash, this has been committed to allow testing
    against the issues which resides in libtracker-fts due to libtracker-fts
    expecting a single threaded use

 src/tracker-needle/tracker-needle.vala |   18 ++++++++++++------
 1 files changed, 12 insertions(+), 6 deletions(-)
---
diff --git a/src/tracker-needle/tracker-needle.vala b/src/tracker-needle/tracker-needle.vala
index e17ac93..8868a11 100644
--- a/src/tracker-needle/tracker-needle.vala
+++ b/src/tracker-needle/tracker-needle.vala
@@ -276,10 +276,13 @@ public class TrackerNeedle {
 			var screen = window.get_screen ();
 			var theme = IconTheme.get_for_screen (screen);
 
-			while (cursor.next ()) {
-				int i;
+			while (true) {
+				bool b = yield cursor.next_async ();
+				if (!b) {
+					break;
+				}
 
-				for (i = 0; i < cursor.n_columns; i++) {
+				for (int i = 0; i < cursor.n_columns; i++) {
 					if (i == 0) {
 						debug ("--> %s", cursor.get_string (i));
 					} else {
@@ -354,10 +357,13 @@ public class TrackerNeedle {
 					return;
 				}
 
-				while (cursor.next ()) {
-					int i;
+				while (true) {
+					bool b = yield cursor.next_async ();
+					if (!b) {
+						break;
+					}
 
-					for (i = 0; i < cursor.n_columns; i++) {
+					for (int i = 0; i < cursor.n_columns; i++) {
 						if (i == 0) {
 							debug ("--> %s", cursor.get_string (i));
 						} else {



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