summaryrefslogtreecommitdiff
path: root/gtk/gtkmaplistmodel.c
diff options
context:
space:
mode:
authorBenjamin Otte <otte@redhat.com>2018-09-18 07:27:48 +0200
committerBenjamin Otte <otte@redhat.com>2018-09-18 08:02:21 +0200
commit29c700d1c73094715ec510f8677934f27952fcc3 (patch)
tree13d7ceb5a1186d2bde65221beafcfe7a7dc44391 /gtk/gtkmaplistmodel.c
parent0d7c987b1af7b08aa6c6dc5727ed0ecac35037aa (diff)
downloadgtk+-29c700d1c73094715ec510f8677934f27952fcc3.tar.gz
listmodels: Clarify documentation for function prototypes
Fixes #1341
Diffstat (limited to 'gtk/gtkmaplistmodel.c')
-rw-r--r--gtk/gtkmaplistmodel.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/gtk/gtkmaplistmodel.c b/gtk/gtkmaplistmodel.c
index 6a3de78f8b..6f5e331d80 100644
--- a/gtk/gtkmaplistmodel.c
+++ b/gtk/gtkmaplistmodel.c
@@ -180,6 +180,11 @@ gtk_map_list_model_get_item (GListModel *list,
}
node->item = self->map_func (g_list_model_get_item (self->model, position), self->user_data);
+ if (!G_TYPE_CHECK_INSTANCE_TYPE (node->item, self->item_type))
+ {
+ g_critical ("Map function returned a %s, but it is not a subtype of the model's type %s",
+ G_OBJECT_TYPE_NAME (node->item), g_type_name (self->item_type));
+ }
g_object_add_weak_pointer (node->item, &node->item);
return node->item;