gui/model: Add support for gtk_tree_model_get_flags()

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
This commit is contained in:
Anna Schumaker 2016-01-16 11:03:30 -05:00
parent ddcb973d8e
commit f5fba1680a
2 changed files with 9 additions and 0 deletions

View File

@ -8,6 +8,11 @@ static const GInterfaceInfo queue_tree_model;
static GObjectClass *parent_class = NULL;
static GtkTreeModelFlags _queue_model_get_flags(GtkTreeModel *model)
{
return GTK_TREE_MODEL_LIST_ONLY;
}
static void _queue_model_init(GuiQueueModel *model)
{
model->gqm_stamp = g_random_int();
@ -30,6 +35,7 @@ static void _queue_model_class_init(GuiQueueModelClass *class)
static void _queue_tree_model_init(GtkTreeModelIface *iface)
{
iface->get_flags = _queue_model_get_flags;
}

View File

@ -11,6 +11,9 @@ static void test_model()
test_not_equal((void *)model, NULL);
test_equal(GTK_IS_TREE_MODEL(model), true);
test_equal(gtk_tree_model_get_flags(GTK_TREE_MODEL(model)),
GTK_TREE_MODEL_LIST_ONLY);
g_object_unref(model);
test_equal(G_IS_OBJECT(model), false);
}