diff options
author | Marco Trevisan (Treviño) <mail@3v1n0.net> | 2018-07-17 04:15:11 +0200 |
---|---|---|
committer | Marco Trevisan (Treviño) <mail@3v1n0.net> | 2018-07-26 04:18:53 +0200 |
commit | 16d8b80cc482acb3d7bd725c4daf2a1b29ad6a3e (patch) | |
tree | 7c869e2d5901e3ae8bf90ff8d41a66863ea18399 /src/nautilus-window-slot.c | |
parent | 99f55748ef69a68df86b9a039998ee576d59b898 (diff) | |
download | nautilus-16d8b80cc482acb3d7bd725c4daf2a1b29ad6a3e.tar.gz |
shell: pass the full query to the slot to preserve all settings
Instead of just opening a window with just the location and search terms,
we should pass to the window slot the full nautilus query with all the
shell search provider flags, so that they will be respected and that the
results in the overview will respect the ones in nautilus
Diffstat (limited to 'src/nautilus-window-slot.c')
-rw-r--r-- | src/nautilus-window-slot.c | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/src/nautilus-window-slot.c b/src/nautilus-window-slot.c index f3e596445..90069cbde 100644 --- a/src/nautilus-window-slot.c +++ b/src/nautilus-window-slot.c @@ -98,6 +98,7 @@ typedef struct /* Query editor */ NautilusQueryEditor *query_editor; + NautilusQuery *pending_search_query; gulong qe_changed_id; gulong qe_cancel_id; gulong qe_activated_id; @@ -111,7 +112,6 @@ typedef struct * finish. Used for showing a spinner to provide feedback to the user. */ gboolean allow_stop; gboolean needs_reload; - gchar *pending_search_text; /* New location. */ GFile *pending_location; @@ -376,9 +376,9 @@ update_search_visible (NautilusWindowSlot *self) } } - if (priv->pending_search_text) + if (priv->pending_search_query) { - nautilus_window_slot_search (self, g_strdup (priv->pending_search_text)); + nautilus_window_slot_search (self, g_object_ref (priv->pending_search_query)); } } @@ -599,17 +599,13 @@ nautilus_window_slot_get_search_visible (NautilusWindowSlot *self) void nautilus_window_slot_search (NautilusWindowSlot *self, - const gchar *text) + NautilusQuery *query) { NautilusWindowSlotPrivate *priv; NautilusView *view; priv = nautilus_window_slot_get_instance_private (self); - if (priv->pending_search_text) - { - g_free (priv->pending_search_text); - priv->pending_search_text = NULL; - } + g_clear_object (&priv->pending_search_query); view = nautilus_window_slot_get_current_view (self); /* We could call this when the location is still being checked in the @@ -618,11 +614,11 @@ nautilus_window_slot_search (NautilusWindowSlot *self, if (view) { nautilus_window_slot_set_search_visible (self, TRUE); - nautilus_query_editor_set_text (priv->query_editor, text); + nautilus_query_editor_set_query (priv->query_editor, query); } else { - priv->pending_search_text = g_strdup (text); + priv->pending_search_query = g_object_ref (query); } } @@ -3087,6 +3083,7 @@ nautilus_window_slot_dispose (GObject *object) g_clear_object (&priv->current_location_bookmark); g_clear_object (&priv->last_location_bookmark); g_clear_object (&priv->slot_action_group); + g_clear_object (&priv->pending_search_query); g_clear_pointer (&priv->find_mount_cancellable, g_cancellable_cancel); |