[PATCH 2/2] test-ui: Support search all



If search text entry is empty, perform a search all.

Signed-off-by: Juan A. Suarez Romero <jasuarez igalia com>
---
 tools/grilo-test-ui/main.c |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/tools/grilo-test-ui/main.c b/tools/grilo-test-ui/main.c
index 0c91f56..6d15117 100644
--- a/tools/grilo-test-ui/main.c
+++ b/tools/grilo-test-ui/main.c
@@ -1078,7 +1078,12 @@ search_btn_clicked_cb (GtkButton *btn, gpointer user_data)
 			SEARCH_MODEL_SOURCE, &source,
 			-1);
     text = gtk_entry_get_text (GTK_ENTRY (view->search_text));
-    search (source, text);
+    /* Special case: empty search means search all */
+    if (text[0] == '\0') {
+      search (source, NULL);
+    } else {
+      search (source, text);
+    }
 
     if (source) {
       g_object_unref (source);
-- 
1.7.3.5



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