[glib/wip/otte/liststore-properties: 1/3] liststore: Use g_object_class_install_properties()




commit 9b55841d78fbfebf0efd335cfa49927ce1646a97
Author: Benjamin Otte <otte redhat com>
Date:   Wed Jun 8 15:45:27 2022 +0200

    liststore: Use g_object_class_install_properties()
    
    Not very useful yet, but future commits add more properties.

 gio/gliststore.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
---
diff --git a/gio/gliststore.c b/gio/gliststore.c
index bab3c8e159..555b4f310f 100644
--- a/gio/gliststore.c
+++ b/gio/gliststore.c
@@ -72,6 +72,8 @@ static void g_list_store_iface_init (GListModelInterface *iface);
 G_DEFINE_TYPE_WITH_CODE (GListStore, g_list_store, G_TYPE_OBJECT,
                          G_IMPLEMENT_INTERFACE (G_TYPE_LIST_MODEL, g_list_store_iface_init));
 
+static GParamSpec *properties[N_PROPERTIES] = { NULL, };
+
 static void
 g_list_store_items_changed (GListStore *store,
                             guint       position,
@@ -155,9 +157,11 @@ g_list_store_class_init (GListStoreClass *klass)
    *
    * Since: 2.44
    **/
-  g_object_class_install_property (object_class, PROP_ITEM_TYPE,
+  properties[PROP_ITEM_TYPE] = 
     g_param_spec_gtype ("item-type", "", "", G_TYPE_OBJECT,
-                        G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
+                        G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
+
+  g_object_class_install_properties (object_class, N_PROPERTIES, properties);
 }
 
 static GType


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