[nautilus] window-slot: Use accessor function to get current location



commit 7500b038078c3fc1000aea48d73d74b5f0ddd485
Author: Sachin Daluja <30343-sachindaluja users noreply gitlab gnome org>
Date:   Sat May 30 19:03:47 2020 -0400

    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.

 src/nautilus-window-slot.c | 13 ++++++++-----
 1 file 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");
         }


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