[glib/wip/otte/liststore-properties] listmodel: Recommend implementing properties



commit 578cc88bca4011e192ccaecca797d104d933715c
Author: Benjamin Otte <otte redhat com>
Date:   Thu Jun 9 17:03:09 2022 +0200

    listmodel: Recommend implementing properties
    
    "item-type" and "n-items" should ideally be implemented by listmodels,
    so document that.

 gio/glistmodel.c | 6 ++++++
 1 file changed, 6 insertions(+)
---
diff --git a/gio/glistmodel.c b/gio/glistmodel.c
index 94f183ecca..4a5dc5c745 100644
--- a/gio/glistmodel.c
+++ b/gio/glistmodel.c
@@ -84,6 +84,12 @@ G_DEFINE_INTERFACE (GListModel, g_list_model, G_TYPE_OBJECT)
  * implementation, but typically it will be from the thread that owns
  * the [thread-default main context][g-main-context-push-thread-default]
  * in effect at the time that the model was created.
+ *
+ * Over time, it has established itself as good practice for listmodel
+ * implementations to provide properties `item-type` and `n-items` to
+ * ease working with them. While it is not required, it is recommended
+ * that implementations provide these two properties. #GListStore is
+ * the recommended example of such an implementation.
  */
 
 /**


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