[tracker/new-tracker-search-tool] Get rid of type warning and use a clear search result signal to indicate invalid search
- From: Jamie McCracken <jamiemcc src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [tracker/new-tracker-search-tool] Get rid of type warning and use a clear search result signal to indicate invalid search
- Date: Tue, 22 Sep 2009 03:54:17 +0000 (UTC)
commit 9283eb0db5a98da2e8a5c1d2f23f6dd864dd77d4
Author: Jamie McCracken <jamiemcc gnome org>
Date: Mon Sep 21 23:57:22 2009 -0400
Get rid of type warning and use a clear search result signal to indicate invalid search
src/tracker-search-tool/tracker-query.gs | 21 ++++++++++++---------
src/tracker-search-tool/tracker-result-grid.gs | 3 +++
2 files changed, 15 insertions(+), 9 deletions(-)
---
diff --git a/src/tracker-search-tool/tracker-query.gs b/src/tracker-search-tool/tracker-query.gs
index 3e90dc1..5696033 100644
--- a/src/tracker-search-tool/tracker-query.gs
+++ b/src/tracker-search-tool/tracker-query.gs
@@ -10,7 +10,8 @@ class TrackerQuery : Object
tracker : Resources;
- event SearchSettingsChanged ()
+ event SearchSettingsChanged ()
+ event ClearSearchResults ()
prop SearchTerms : string
prop Category : string
@@ -22,10 +23,15 @@ class TrackerQuery : Object
Category = "All"
self.notify += def (t, propety)
- if propety.name is "SearchTerms" or propety.name is "Category" or propety.name is "SortField" or propety.name is "Fields"
+ if propety.name is "Category" or propety.name is "SortField" or propety.name is "Fields"
SearchSettingsChanged ()
-
-
+ else
+ if propety.name is "SearchTerms"
+ if SearchTerms is null or SearchTerms.length < 3
+ ClearSearchResults ()
+ else
+ SearchSettingsChanged ()
+
def Connect () : bool
@@ -43,13 +49,10 @@ class TrackerQuery : Object
query : string
- if SearchTerms is null or SearchTerms.length < 3
- return null
-
if Category is null or Category is "All"
- query = "SELECT ?s WHERE { ?s fts:match \"%s*\"} limit 100 ".printf(SearchTerms)
+ query = "SELECT ?s WHERE { ?s fts:match \"%s\". ?s a nie:InformationElement } limit 100 ".printf(SearchTerms)
else
- query = "SELECT ?s WHERE { ?s fts:match \"%s*\". ?s a %s} limit 100 ".printf(SearchTerms, Category)
+ query = "SELECT ?s WHERE { ?s fts:match \"%s\". ?s a %s} limit 100 ".printf(SearchTerms, Category)
// to do : add Fields, Category and SortField
return tracker.SparqlQuery (query)
diff --git a/src/tracker-search-tool/tracker-result-grid.gs b/src/tracker-search-tool/tracker-result-grid.gs
index a5af1e0..fdf48f9 100644
--- a/src/tracker-search-tool/tracker-result-grid.gs
+++ b/src/tracker-search-tool/tracker-result-grid.gs
@@ -31,6 +31,9 @@ class TrackerResultGrid : ScrolledWindow
_query = value
_query.SearchSettingsChanged += def ()
RefreshQuery ()
+ _query.ClearSearchResults += def ()
+ store.clear ()
+
init
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]