]> Pileus Git - ~andy/gtk/commitdiff
Add a helper for inserting paths in the test tree store
authorKristian Rietveld <kris@gtk.org>
Tue, 1 Sep 2009 07:39:11 +0000 (09:39 +0200)
committerKristian Rietveld <kris@gtk.org>
Sat, 5 Sep 2009 15:15:41 +0000 (17:15 +0200)
gtk/tests/filtermodel.c

index e0b6a959774923a8869be8690e37e38c718b0f65..9c219262b39321ef3c418a7ce3e29b2b0b366844 100644 (file)
@@ -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.
  */