[nautilus/wip/gbsneto/search-popover: 7/7] files-view: also use mimetype to detect empty search
- From: Georges Basile Stavracas Neto <gbsneto src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [nautilus/wip/gbsneto/search-popover: 7/7] files-view: also use mimetype to detect empty search
- Date: Tue, 6 Oct 2015 00:23:55 +0000 (UTC)
commit 9f323f6367ff2630e92f2f8e05b80eafe67ead15
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date: Mon Oct 5 21:21:52 2015 -0300
files-view: also use mimetype to detect empty search
We can search for mimetypes only.
src/nautilus-files-view.c | 7 ++++++-
1 files changed, 6 insertions(+), 1 deletions(-)
---
diff --git a/src/nautilus-files-view.c b/src/nautilus-files-view.c
index 0846913..28ada4d 100644
--- a/src/nautilus-files-view.c
+++ b/src/nautilus-files-view.c
@@ -7676,14 +7676,18 @@ nautilus_files_view_set_search_query (NautilusView *view,
{
NautilusFilesView *files_view;
GFile *location;
+ GList *mimetypes;
gchar *text;
gboolean valid_query = FALSE;
files_view = NAUTILUS_FILES_VIEW (view);
+ mimetypes = NULL;
location = NULL;
if (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;
g_free (text);
}
@@ -7737,6 +7741,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]