[gtk/wip/otte/for-master] flattenlistmodel: Do proper check



commit f1f24cc09b3505c6ce021390f7fae312c3a9f354
Author: Benjamin Otte <otte redhat com>
Date:   Wed May 15 22:18:56 2019 +0200

    flattenlistmodel: Do proper check
    
    If we want the model items to be listmodels, we don't need to do a ==
    comparison. We need to do g_type_is_a(). Implementations of listmodels
    are obviously fine.

 gtk/gtkflattenlistmodel.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
---
diff --git a/gtk/gtkflattenlistmodel.c b/gtk/gtkflattenlistmodel.c
index 614493e28f..822f63ff54 100644
--- a/gtk/gtkflattenlistmodel.c
+++ b/gtk/gtkflattenlistmodel.c
@@ -486,7 +486,7 @@ gtk_flatten_list_model_set_model (GtkFlattenListModel *self,
   g_return_if_fail (model == NULL || G_IS_LIST_MODEL (model));
   if (model)
     {
-      g_return_if_fail (g_list_model_get_item_type (model) == G_TYPE_LIST_MODEL);
+      g_return_if_fail (g_type_is_a (g_list_model_get_item_type (model), G_TYPE_LIST_MODEL);
     }
 
   if (self->model == model)


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