[nautilus/wip/gbsneto/search-popover: 19/20] files-view: also use mimetype and date to detect empty search



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

    files-view: also use mimetype and date to detect empty search
    
    We can search for mimetypes or date only.

 src/nautilus-files-view.c |   10 +++++++++-
 1 files changed, 9 insertions(+), 1 deletions(-)
---
diff --git a/src/nautilus-files-view.c b/src/nautilus-files-view.c
index 32be4da..0e942f0 100644
--- a/src/nautilus-files-view.c
+++ b/src/nautilus-files-view.c
@@ -7808,15 +7808,22 @@ nautilus_files_view_set_search_query (NautilusView  *view,
                                       NautilusQuery *query)
 {
         NautilusFilesView *files_view;
+        GDateTime *dt;
         GFile *location;
+        GList *mimetypes;
         gchar *text;
         gboolean valid_query = FALSE;
 
         files_view = NAUTILUS_FILES_VIEW (view);
+        mimetypes = NULL;
         location = NULL;
+        dt = NULL;
         if (query) {
+                dt = nautilus_query_get_date (query);
                 text = nautilus_query_get_text (query);
-                valid_query = strlen (text) > 0;
+                mimetypes = nautilus_query_get_mime_types (query);
+
+                valid_query = strlen (text) > 0 || mimetypes != NULL || dt != NULL;
 
                 g_free (text);
         }
@@ -7871,6 +7878,7 @@ nautilus_files_view_set_search_query (NautilusView  *view,
                 }
         }
         check_remote_warning_bar (files_view);
+        g_list_free_full (mimetypes, g_free);
         g_clear_object (&location);
 }
 


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