inspector: Store the parent for the object tree

This allows selecting newly added random objects.

https://bugzilla.gnome.org/show_bug.cgi?id=754987
This commit is contained in:
Benjamin Otte 2015-09-14 23:32:16 +02:00
parent 018856df23
commit bcc0a54383

View File

@ -103,7 +103,7 @@ G_DEFINE_TYPE_WITH_PRIVATE (GtkInspectorObjectTree, gtk_inspector_object_tree, G
static GObject * static GObject *
object_tree_get_parent_default (GObject *object) object_tree_get_parent_default (GObject *object)
{ {
return NULL; return g_object_get_data (object, "inspector-object-tree-parent");
} }
static void static void
@ -990,7 +990,18 @@ gtk_inspector_object_tree_append_object (GtkInspectorObjectTree *wt,
g_list_free (list); g_list_free (list);
} }
else else
classes = g_strdup (""); {
if (parent_iter)
{
GObject *parent;
gtk_tree_model_get (GTK_TREE_MODEL (wt->priv->model), parent_iter,
OBJECT, &parent,
-1);
g_object_set_data (object, "inspector-object-tree-parent", parent);
}
classes = g_strdup ("");
}
if (GTK_IS_BUILDABLE (object)) if (GTK_IS_BUILDABLE (object))
{ {