summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarlos Soriano <csoriano@gnome.org>2016-01-31 10:13:42 +0100
committerCarlos Soriano <csoriano@gnome.org>2016-02-02 22:22:38 +0100
commit4f23b0e903a84f4692f6a500feca5c618b59fbd4 (patch)
tree3ec46d7587aee5b9387eb43b58bbdc143313c6c9
parent795c0402155f883de8316cff6fc7835e9f3ea14e (diff)
downloadnautilus-4f23b0e903a84f4692f6a500feca5c618b59fbd4.tar.gz
window-slot: close search when changing location
And the query is empty, as in no mimetypes, date or text to search.
-rw-r--r--src/nautilus-window-slot.c5
1 files changed, 1 insertions, 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);
}
}