[nautilus/wip/gbsneto/search-popover: 3/6] window-slot: reload search when recursive flag changes



commit 67a768864de61907df46df43b627006053c49a70
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date:   Mon Oct 5 21:20:51 2015 -0300

    window-slot: reload search when recursive flag changes
    
    When the user decides to not have the recursive search
    and we are performing a search, reload the current search
    so it respects the use setting.

 src/nautilus-window-slot.c |   18 ++++++++++++++++++
 1 files changed, 18 insertions(+), 0 deletions(-)
---
diff --git a/src/nautilus-window-slot.c b/src/nautilus-window-slot.c
index dd9d080..7b8891a 100644
--- a/src/nautilus-window-slot.c
+++ b/src/nautilus-window-slot.c
@@ -615,6 +615,18 @@ nautilus_window_slot_get_property (GObject *object,
 }
 
 static void
+recursive_search_setting_changed (NautilusWindowSlot *slot)
+{
+        NautilusView *view;
+
+        view = nautilus_window_slot_get_current_view (slot);
+
+        if (nautilus_view_is_searching (view)) {
+                nautilus_window_slot_force_reload (slot);
+        }
+}
+
+static void
 nautilus_window_slot_constructed (GObject *object)
 {
        NautilusWindowSlot *slot = NAUTILUS_WINDOW_SLOT (object);
@@ -639,6 +651,12 @@ nautilus_window_slot_constructed (GObject *object)
                                 slot->details->query_editor, "location",
                                 G_BINDING_DEFAULT);
 
+        /* Reload searches whenever the recursive-search setting changes */
+        g_signal_connect_swapped (nautilus_preferences,
+                                  "changed::enable-recursive-search",
+                                  G_CALLBACK (recursive_search_setting_changed),
+                                  object);
+
        slot->details->title = g_strdup (_("Loading…"));
 }
 


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