From 81bc45ee69834215ffcf2c69fbd5b3f458287fec Mon Sep 17 00:00:00 2001 From: Kristian Rietveld Date: Tue, 1 Sep 2009 09:39:11 +0200 Subject: [PATCH] Add a helper for inserting paths in the test tree store --- gtk/tests/filtermodel.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/gtk/tests/filtermodel.c b/gtk/tests/filtermodel.c index e0b6a95977..9c219262b3 100644 --- a/gtk/tests/filtermodel.c +++ b/gtk/tests/filtermodel.c @@ -289,6 +289,27 @@ set_path_visibility (FilterTest *fixture, -1); } +static void +insert_path_with_visibility (FilterTest *fixture, + const gchar *path_string, + gboolean visible) +{ + int position; + GtkTreePath *path; + GtkTreeIter parent, iter; + + path = gtk_tree_path_new_from_string (path_string); + position = gtk_tree_path_get_indices (path)[gtk_tree_path_get_depth (path)]; + gtk_tree_path_up (path); + + if (gtk_tree_model_get_iter (GTK_TREE_MODEL (fixture->store), &parent, path)) + { + gtk_tree_store_insert (fixture->store, &iter, &parent, position); + create_tree_store_set_values (fixture->store, &iter, visible); + } + gtk_tree_path_free (path); +} + /* * The actual tests. */