diff options
author | Sachin Daluja <30343-sachindaluja@users.noreply.gitlab.gnome.org> | 2020-05-30 19:03:47 -0400 |
---|---|---|
committer | António Fernandes <antoniojpfernandes@gmail.com> | 2020-07-12 16:27:10 +0000 |
commit | 7500b038078c3fc1000aea48d73d74b5f0ddd485 (patch) | |
tree | cef71667d9be3c970a7b94d2e8ba3c202916e9d5 | |
parent | 691f1cf1bde256c94e126c1a2bb111aaff630b72 (diff) | |
download | nautilus-7500b038078c3fc1000aea48d73d74b5f0ddd485.tar.gz |
window-slot: Use accessor function to get current location
In function update_search_information() which may be called when the slot is
in the process of updating it's location. Use the location accessor function
nautilus_window_slot_get_current_location() which returns the correct location
when the slot is in the process of updating it's location related data
structures.
-rw-r--r-- | src/nautilus-window-slot.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/src/nautilus-window-slot.c b/src/nautilus-window-slot.c index ada81a9f1..b5ff00008 100644 --- a/src/nautilus-window-slot.c +++ b/src/nautilus-window-slot.c @@ -1140,6 +1140,7 @@ static void update_search_information (NautilusWindowSlot *self) { NautilusWindowSlotPrivate *priv; + GFile *location; priv = nautilus_window_slot_get_instance_private (self); @@ -1150,15 +1151,17 @@ update_search_information (NautilusWindowSlot *self) return; } - if (priv->location) + location = nautilus_window_slot_get_current_location (self); + + if (location) { g_autoptr (NautilusFile) file = NULL; gchar *label; g_autofree gchar *uri = NULL; - file = nautilus_file_get (priv->location); + file = nautilus_file_get (location); label = NULL; - uri = g_file_get_uri (priv->location); + uri = g_file_get_uri (location); if (nautilus_file_is_other_locations (file)) { @@ -1169,11 +1172,11 @@ update_search_information (NautilusWindowSlot *self) label = _("Searching network locations only"); } else if (nautilus_file_is_remote (file) && - location_settings_search_get_recursive_for_location (priv->location) == NAUTILUS_QUERY_RECURSIVE_NEVER) + location_settings_search_get_recursive_for_location (location) == NAUTILUS_QUERY_RECURSIVE_NEVER) { label = _("Remote location — only searching the current folder"); } - else if (location_settings_search_get_recursive_for_location (priv->location) == NAUTILUS_QUERY_RECURSIVE_NEVER) + else if (location_settings_search_get_recursive_for_location (location) == NAUTILUS_QUERY_RECURSIVE_NEVER) { label = _("Only searching the current folder"); } |