From 4f23b0e903a84f4692f6a500feca5c618b59fbd4 Mon Sep 17 00:00:00 2001 From: Carlos Soriano Date: Sun, 31 Jan 2016 10:13:42 +0100 Subject: window-slot: close search when changing location And the query is empty, as in no mimetypes, date or text to search. --- src/nautilus-window-slot.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/nautilus-window-slot.c b/src/nautilus-window-slot.c index 7b3dcfcf9..9d20fb21b 100644 --- a/src/nautilus-window-slot.c +++ b/src/nautilus-window-slot.c @@ -252,7 +252,6 @@ update_search_visible (NautilusWindowSlot *slot) { NautilusQuery *query; NautilusView *view; - gchar *text; GAction *action; action = g_action_map_lookup_action (G_ACTION_MAP (slot->details->slot_action_group), @@ -273,13 +272,11 @@ update_search_visible (NautilusWindowSlot *slot) query = nautilus_query_editor_get_query (slot->details->query_editor); if (query) { - text = nautilus_query_get_text (query); /* If the view is not searching, but search is visible, and the * query is empty, we don't hide it. Some users enable the search * and then change locations, then they search. */ - if (strlen (text) != 0) + if (!nautilus_query_is_empty (query)) nautilus_window_slot_set_search_visible (slot, FALSE); - g_free (text); g_object_unref (query); } } -- cgit v1.2.1