[nautilus/wip/gbsneto/search-popover: 5/7] files-view: use nautilus_query_is_empty to validate query



commit ad5c728c40fcec0d96b22d877ef63c4785c5d180
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date:   Mon Oct 5 21:21:52 2015 -0300

    files-view: use nautilus_query_is_empty to validate query
    
    The previous commits introduced a new function to NautilusQuery
    that performs the check we're doing here. Use this API to validate
    the query.

 src/nautilus-files-view.c |   10 +---------
 1 files changed, 1 insertions(+), 9 deletions(-)
---
diff --git a/src/nautilus-files-view.c b/src/nautilus-files-view.c
index bda80c0..e87d062 100644
--- a/src/nautilus-files-view.c
+++ b/src/nautilus-files-view.c
@@ -7847,22 +7847,14 @@ nautilus_files_view_set_search_query (NautilusView  *view,
 {
         NautilusFilesView *files_view;
         GFile *location;
-        gchar *text;
-        gboolean valid_query = FALSE;
 
         files_view = NAUTILUS_FILES_VIEW (view);
         location = NULL;
-        if (query) {
-                text = nautilus_query_get_text (query);
-                valid_query = strlen (text) > 0;
-
-                g_free (text);
-        }
 
         g_set_object (&files_view->details->search_query, query);
         g_object_notify (G_OBJECT (view), "search-query");
 
-        if (valid_query) {
+        if (!nautilus_query_is_empty (query)) {
                 if (nautilus_view_is_searching (view)) {
                         location = nautilus_directory_get_location (files_view->details->model);
 


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