From 5c3b36892566bfd8e2824428db8c826b483469f6 Mon Sep 17 00:00:00 2001 From: Benjamin Otte Date: Fri, 1 Oct 2021 00:31:51 +0000 Subject: [PATCH] docs: Add note about stable sorting to SortListModel --- gtk/gtksortlistmodel.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/gtk/gtksortlistmodel.c b/gtk/gtksortlistmodel.c index 3a1d14fe05..2d706ba521 100644 --- a/gtk/gtksortlistmodel.c +++ b/gtk/gtksortlistmodel.c @@ -58,6 +58,13 @@ * A `GListModel` that sorts the elements of an underlying model * according to a `GtkSorter`. * + * The model is a stable sort. If two items compare equal according + * to the sorter, the one that appears first in the original model will + * also appear first after sorting. + * Note that if you change the sorter, the previous order will have no + * influence on the new order. If you want that, consider using a + * `GtkMultiSorter` and appending the previous sorter to it. + * * The model can be set up to do incremental sorting, so that * sorting long lists doesn't block the UI. See * [method@Gtk.SortListModel.set_incremental] for details.