[tracker/needle: 39/53] tracker-needle: Fixed spinner, so it doesn't stop immediately after starting



commit eaa51f8a70943f930d85b74459a01d9de629bd67
Author: Martyn Russell <martyn lanedo com>
Date:   Mon Sep 20 22:16:12 2010 +0100

    tracker-needle: Fixed spinner, so it doesn't stop immediately after starting

 src/tracker-needle/tracker-needle.vala |   28 +++++++++++++++++-----------
 1 files changed, 17 insertions(+), 11 deletions(-)
---
diff --git a/src/tracker-needle/tracker-needle.vala b/src/tracker-needle/tracker-needle.vala
index 8868a11..366859c 100644
--- a/src/tracker-needle/tracker-needle.vala
+++ b/src/tracker-needle/tracker-needle.vala
@@ -256,7 +256,7 @@ public class TrackerNeedle {
 		Tracker.Query query = new Tracker.Query ();
 		Tracker.Sparql.Cursor cursor = null;
 
-		query.limit = 100;
+		query.limit = 1000;
 		query.criteria = search.get_text ();
 
 		try {
@@ -267,7 +267,7 @@ public class TrackerNeedle {
 			}
 
 			if (cursor == null) {
-				// FIXME: Print "no results" some where
+				search_finished ();
 				return;
 			}
 
@@ -321,8 +321,11 @@ public class TrackerNeedle {
 			}
 		} catch (GLib.Error e) {
 			warning ("Could not iterate query results: %s", e.message);
+			search_finished ();
 			return;
 		}
+
+		search_finished ();
 	}
 
 	private async void search_detailed () {
@@ -346,14 +349,14 @@ public class TrackerNeedle {
 
 			Tracker.Sparql.Cursor cursor;
 
-			query.limit = 100;
+			query.limit = 1000;
 			query.criteria = search.get_text ();
 
 			try {
 				cursor = yield query.perform_async (type);
 
 				if (cursor == null) {
-					// FIXME: Print "no results" some where
+					search_finished ();
 					return;
 				}
 
@@ -445,6 +448,7 @@ public class TrackerNeedle {
 				}
 			} catch (GLib.Error e) {
 				warning ("Could not iterate query results: %s", e.message);
+				search_finished ();
 				return;
 			}
 
@@ -452,6 +456,14 @@ public class TrackerNeedle {
 				odd = !odd;
 			}
 		}
+
+		search_finished ();
+	}
+
+	private void search_finished () {
+		// Hide spinner
+		spinner.stop ();
+		spinner_shell.hide ();
 	}
 
 	private bool search_run () {
@@ -463,9 +475,7 @@ public class TrackerNeedle {
 			sw_iconview.hide ();
 			sw_treeview.hide ();
 
-			// Hide spinner
-			spinner.stop ();
-			spinner_shell.hide ();
+			search_finished ();
 
 			return false;
 		}
@@ -493,10 +503,6 @@ public class TrackerNeedle {
 			search_simple ();
 		}
 
-		// Hide spinner
-		spinner.stop ();
-		spinner_shell.hide ();
-
 		return false;
 	}
 



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