[gtk/otte/for-master2] docs: Add note about stable sorting to SortListModel




commit 5c3b36892566bfd8e2824428db8c826b483469f6
Author: Benjamin Otte <otte benjamin googlemail com>
Date:   Fri Oct 1 00:31:51 2021 +0000

    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.


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