gui/model: Add support for gtk_tree_model_iter_parent()

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
This commit is contained in:
Anna Schumaker 2016-01-17 10:29:54 -05:00
parent ccf6e4c61f
commit dd2adc6307
2 changed files with 11 additions and 0 deletions

View File

@ -180,6 +180,13 @@ static gboolean _queue_model_iter_nth_child(GtkTreeModel *model,
return __queue_model_iter_nth(GUI_QUEUE_MODEL(model), iter, n);
}
static gboolean _queue_model_iter_parent(GtkTreeModel *model,
GtkTreeIter *iter,
GtkTreeIter *child)
{
return FALSE;
}
static void _queue_model_init(GuiQueueModel *model)
{
model->gqm_stamp = g_random_int();
@ -213,6 +220,7 @@ static void _queue_tree_model_init(GtkTreeModelIface *iface)
iface->iter_has_child = _queue_model_iter_has_child;
iface->iter_n_children = _queue_model_iter_n_children;
iface->iter_nth_child = _queue_model_iter_nth_child;
iface->iter_parent = _queue_model_iter_parent;
}

View File

@ -93,6 +93,7 @@ static void test_empty()
test_equal(gtk_tree_model_iter_n_children(model, &iter), 0);
test_equal(gtk_tree_model_iter_n_children(model, NULL), 0);
test_equal(gtk_tree_model_iter_nth_child(model, &iter, NULL, 3), false);
test_equal(gtk_tree_model_iter_parent(model, &iter, &iter), false);
g_object_unref(model);
}
@ -173,6 +174,8 @@ static void test_model()
track = iter.user_data2;
test_equal(track->tr_track, 4);
test_equal(gtk_tree_model_iter_parent(model, &iter, &iter), false);
g_object_unref(model);
}