[tracker] tracker-needle: Connect to search.activate to trigger query immediately.
- From: Martyn James Russell <mr src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [tracker] tracker-needle: Connect to search.activate to trigger query immediately.
- Date: Thu, 24 Mar 2011 23:17:36 +0000 (UTC)
commit 3d14dcde1f4c705ac4a96d51dda6f6db7fff13ca
Author: Carlos Garnacho <carlosg gnome org>
Date: Thu Mar 17 18:43:09 2011 +0100
tracker-needle: Connect to search.activate to trigger query immediately.
src/tracker-needle/tracker-needle.vala | 12 ++++++++++--
1 files changed, 10 insertions(+), 2 deletions(-)
---
diff --git a/src/tracker-needle/tracker-needle.vala b/src/tracker-needle/tracker-needle.vala
index 174643f..e5b515f 100644
--- a/src/tracker-needle/tracker-needle.vala
+++ b/src/tracker-needle/tracker-needle.vala
@@ -143,6 +143,7 @@ public class Tracker.Needle {
search_list = builder.get_object ("comboboxentry_search") as ComboBoxEntry;
search = search_list.get_child () as Entry;
search.changed.connect (search_changed);
+ search.activate.connect (search_activated);
search_history_insert (history.get ());
spinner = new Spinner ();
@@ -219,6 +220,15 @@ public class Tracker.Needle {
last_search_id = Timeout.add_seconds (1, search_run);
}
+ private void search_activated (Entry entry) {
+ if (last_search_id != 0) {
+ Source.remove (last_search_id);
+ last_search_id = 0;
+ }
+
+ search_run ();
+ }
+
private async void search_simple (ListStore store) requires (store != null) {
/*
Tracker.Query query = new Tracker.Query ();
@@ -330,8 +340,6 @@ public class Tracker.Needle {
query.limit = 1000;
query.criteria = search.get_text ();
- print (search.get_text ());
-
try {
cursor = yield query.perform_async (type, null);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]