sortlistmodel: Actually insert unsorted items at the wrong place

We were adding items in reverse order, oops.
This commit is contained in:
Benjamin Otte 2018-09-17 03:50:56 +02:00
parent 8bdcff3320
commit b92c328425

View File

@ -174,7 +174,7 @@ gtk_sort_list_model_add_items (GtkSortListModel *self,
{
gpointer item = g_list_model_get_item (self->model, position + i);
sorted_iter = g_sequence_insert_sorted (self->sorted, item, self->sort_func, self->user_data);
unsorted_iter = g_sequence_insert_before (unsorted_iter, sorted_iter);
g_sequence_insert_before (unsorted_iter, sorted_iter);
if (unmodified_start != NULL || unmodified_end != NULL)
{
pos = g_sequence_iter_get_position (sorted_iter);
@ -186,7 +186,7 @@ gtk_sort_list_model_add_items (GtkSortListModel *self,
if (unmodified_start)
*unmodified_start = start;
if (unmodified_end)
*unmodified_end = end;
*unmodified_end = end;
}
static void