[tracker/tracker-0.12] tracker-needle: Disable search entry when filtering by tag list
- From: Martyn James Russell <mr src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [tracker/tracker-0.12] tracker-needle: Disable search entry when filtering by tag list
- Date: Thu, 6 Oct 2011 10:37:37 +0000 (UTC)
commit 5c2a89516371a32eb6ca028ef2743246365b99db
Author: Martyn Russell <martyn lanedo com>
Date: Mon Jun 27 09:26:30 2011 +0100
tracker-needle: Disable search entry when filtering by tag list
Also fixes some criticals when filtering by tags
src/tracker-needle/tracker-needle.vala | 29 ++++++++++++++++++++---------
src/tracker-needle/tracker-query.vala | 12 +++++++-----
2 files changed, 27 insertions(+), 14 deletions(-)
---
diff --git a/src/tracker-needle/tracker-needle.vala b/src/tracker-needle/tracker-needle.vala
index 62f4552..932ffe8 100644
--- a/src/tracker-needle/tracker-needle.vala
+++ b/src/tracker-needle/tracker-needle.vala
@@ -331,10 +331,11 @@ public class Tracker.Needle {
}
private void taglist_selection_changed (GenericArray<string> new_tags) {
- if (new_tags != null && new_tags.length > 0)
+ if (new_tags != null && new_tags.length > 0) {
debug ("Tags selected changed, first:'%s', ...", new_tags[0]);
- else
+ } else {
debug ("Tags selected changed, none selected");
+ }
search_run ();
}
@@ -418,15 +419,17 @@ public class Tracker.Needle {
string criteria = str.strip ();
ResultStore store = null;
- if (criteria.length < 3) {
- // Allow empty search criteria for finding all
- if (!view_icons.active || !find_in_all.active) {
- search_finished (store);
- return false;
+ if (!show_tags.active) {
+ if (criteria.length < 3) {
+ // Allow empty search criteria for finding all
+ if (!view_icons.active || !find_in_all.active) {
+ search_finished (store);
+ return false;
+ }
}
- }
- search_history_find_or_insert (criteria, true);
+ search_history_find_or_insert (criteria, true);
+ }
// Show correct window
sw_noresults.hide ();
@@ -470,6 +473,12 @@ public class Tracker.Needle {
// Set tags first
if (show_tags.active) {
store.search_tags = taglist.tags;
+
+ // Don't search if no tags are selected
+ if (store.search_tags.length < 1) {
+ search_finished (store);
+ return false;
+ }
} else {
store.search_tags = null;
}
@@ -613,9 +622,11 @@ public class Tracker.Needle {
if (show_tags.active) {
debug ("Showing tags");
taglist.show ();
+ search_entry.sensitive = false;
} else {
debug ("Hiding tags");
taglist.hide ();
+ search_entry.sensitive = true;
}
// Re-run search to filter with or without tags
diff --git a/src/tracker-needle/tracker-query.vala b/src/tracker-needle/tracker-query.vala
index f1c4f5a..cfc9755 100644
--- a/src/tracker-needle/tracker-query.vala
+++ b/src/tracker-needle/tracker-query.vala
@@ -244,10 +244,11 @@ public class Tracker.Query {
match_type = Match.TAGS_ONLY;
}
}
-
+ debug ("match_type:%d", match_type);
if (match_type != Match.NONE &&
- match_type != Match.TAGS_ONLY &&
- (criteria == null || criteria.length < 1)) {
+ match_type != Match.TAGS_ONLY &&
+ match_type != Match.TAGS_ONLY_INDIRECT &&
+ (criteria == null || criteria.length < 1)) {
warning ("Criteria was NULL or an empty string no query performed");
return 0;
}
@@ -300,8 +301,9 @@ public class Tracker.Query {
}
if (match_type != Match.NONE &&
- match_type != Match.TAGS_ONLY &&
- (criteria == null || criteria.length < 1)) {
+ match_type != Match.TAGS_ONLY &&
+ match_type != Match.TAGS_ONLY_INDIRECT &&
+ (criteria == null || criteria.length < 1)) {
warning ("Criteria was NULL or an empty string no query performed");
return null;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]