[nautilus/wip/csoriano/search-popover] window-slot: close search when changing location



commit 70d12b1fa143072a9e7bbeb9addad5ac381ac09d
Author: Carlos Soriano <csoriano gnome org>
Date:   Sun Jan 31 10:13:42 2016 +0100

    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 files changed, 1 insertions(+), 4 deletions(-)
---
diff --git a/src/nautilus-window-slot.c b/src/nautilus-window-slot.c
index 7b3dcfc..9d20fb2 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);
         }
 }


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