[gtk+] inspector: Store the parent for the object tree
- From: Benjamin Otte <otte src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] inspector: Store the parent for the object tree
- Date: Mon, 14 Sep 2015 21:37:11 +0000 (UTC)
commit bcc0a54383b65c4e476e481cc0485d49d34adbbc
Author: Benjamin Otte <otte redhat com>
Date: Mon Sep 14 23:32:16 2015 +0200
inspector: Store the parent for the object tree
This allows selecting newly added random objects.
https://bugzilla.gnome.org/show_bug.cgi?id=754987
gtk/inspector/object-tree.c | 15 +++++++++++++--
1 files changed, 13 insertions(+), 2 deletions(-)
---
diff --git a/gtk/inspector/object-tree.c b/gtk/inspector/object-tree.c
index 63e64d5..e3fa925 100644
--- a/gtk/inspector/object-tree.c
+++ b/gtk/inspector/object-tree.c
@@ -103,7 +103,7 @@ G_DEFINE_TYPE_WITH_PRIVATE (GtkInspectorObjectTree, gtk_inspector_object_tree, G
static GObject *
object_tree_get_parent_default (GObject *object)
{
- return NULL;
+ return g_object_get_data (object, "inspector-object-tree-parent");
}
static void
@@ -990,7 +990,18 @@ gtk_inspector_object_tree_append_object (GtkInspectorObjectTree *wt,
g_list_free (list);
}
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))
{
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]