Fix a few bugs in GtkPropertyLookupListModel
authorMatthias Clasen <mclasen@redhat.com>
Tue, 16 May 2023 15:54:59 +0000 (11:54 -0400)
committerMatthias Clasen <mclasen@redhat.com>
Mon, 5 Jun 2023 11:51:09 +0000 (07:51 -0400)
Fix bugs in property types.

gtk/gtkpropertylookuplistmodel.c

index 5fc8af57fa262d4180db1dd68b4519e295e9c8c8..bf8f12b2517a0d7949100ff961e94c5f680c6879 100644 (file)
@@ -329,7 +329,7 @@ gtk_property_lookup_list_model_get_property (GObject     *object,
       break;
 
     case PROP_PROPERTY:
-      g_value_set_object (value, self->property);
+      g_value_set_string (value, self->property);
       break;
 
     default:
@@ -408,7 +408,7 @@ gtk_property_lookup_list_model_class_init (GtkPropertyLookupListModelClass *klas
    */
   properties[PROP_OBJECT] =
       g_param_spec_object ("object", NULL, NULL,
-                           G_TYPE_LIST_MODEL,
+                           G_TYPE_OBJECT,
                            GTK_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY);
 
   g_object_class_install_properties (object_class, NUM_PROPERTIES, properties);
@@ -417,6 +417,7 @@ gtk_property_lookup_list_model_class_init (GtkPropertyLookupListModelClass *klas
 static void
 gtk_property_lookup_list_model_init (GtkPropertyLookupListModel *self)
 {
+  self->item_type = G_TYPE_OBJECT;
   self->items = g_ptr_array_new ();
   /* add sentinel */
   g_ptr_array_add (self->items, NULL);