summaryrefslogtreecommitdiff
path: root/src/nautilus-pathbar.c
diff options
context:
space:
mode:
authorAntónio Fernandes <antoniof@gnome.org>2022-03-19 17:39:41 +0000
committerAntónio Fernandes <antoniof@gnome.org>2022-03-19 17:39:41 +0000
commite55a017bc9b2942bd83d7aaab2d0430ce5344af3 (patch)
tree842bd73475dbf19f902f8fd86545917fca625544 /src/nautilus-pathbar.c
parentae54e48ec712b65448afb4efdd2adf7c904dc2e7 (diff)
downloadnautilus-e55a017bc9b2942bd83d7aaab2d0430ce5344af3.tar.gz
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)
Diffstat (limited to 'src/nautilus-pathbar.c')
-rw-r--r--src/nautilus-pathbar.c7
1 files 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);
}
}