[nautilus] pathbar: Fix button list order regressions



commit e55a017bc9b2942bd83d7aaab2d0430ce5344af3
Author: António Fernandes <antoniof gnome org>
Date:   Sat Mar 19 17:39:41 2022 +0000

    pathbar: Fix button list order regressions
    
    The pathbar code makes the assumption that the first GList link in the
    list of path buttons corresponds to the current location and that each
    subsequent link is corresponds to the parent location of the previous
    one.
    
    This assumption relied on reversing of the list of buttons, which I've
    broken in commit eab10931
    
    Fix the misbehaviours by restoring the list reversion.
    
    (Forward porting 67a3fe05ad2e0994101b0a668af1c6c321f0ca47)

 src/nautilus-pathbar.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
---
diff --git a/src/nautilus-pathbar.c b/src/nautilus-pathbar.c
index ce7c6fee1..389274269 100644
--- a/src/nautilus-pathbar.c
+++ b/src/nautilus-pathbar.c
@@ -1151,13 +1151,16 @@ nautilus_path_bar_update_path (NautilusPathBar *self,
     }
 
     nautilus_path_bar_clear_buttons (self);
-    self->button_list = new_buttons;
+
+    /* Buttons are listed in reverse order such that the current location is
+     * always the first link. */
+    self->button_list = g_list_reverse (new_buttons);
 
     for (l = self->button_list; l; l = l->next)
     {
         GtkWidget *container;
         container = BUTTON_DATA (l->data)->container;
-        gtk_box_append (GTK_BOX (self->buttons_box), container);
+        gtk_box_prepend (GTK_BOX (self->buttons_box), container);
     }
 }
 


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