Commit cfada2b3 by Cosimo Cecchi

pathbar: use another way to remove buttons (#627901)

This fixes a crasher in _size_allocate() where the list of buttons did
not contain valid data anymore.
parent 476d45bf
......@@ -1510,7 +1510,7 @@ button_data_file_changed (NautilusFile *file,
ButtonData *button_data)
{
GFile *location, *current_location, *parent, *button_parent;
ButtonData *current_button_data, *temp_button_data;
ButtonData *current_button_data;
char *display_name;
NautilusPathBar *path_bar;
gboolean renamed, child;
......@@ -1570,18 +1570,17 @@ button_data_file_changed (NautilusFile *file,
return;
}
} else if (nautilus_file_is_gone (file)) {
/* remove this and the following buttons */
GList *children;
children = g_list_find (path_bar->button_list, button_data);
while (children != NULL) {
temp_button_data = children->data;
gint idx, position;
/* children are in reverse order */
children = children->prev;
/* remove this and the following buttons */
position = g_list_position (path_bar->button_list,
g_list_find (path_bar->button_list, button_data));
gtk_container_remove (GTK_CONTAINER (path_bar), temp_button_data->button);
if (position != -1) {
for (idx = 0; idx <= position; idx++) {
gtk_container_remove (GTK_CONTAINER (path_bar),
BUTTON_DATA (path_bar->button_list->data)->button);
}
}
g_object_unref (location);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment