inspector: Fix object-valued properties

The code for dealing with object-valued properties had several
bugs that lead to crashes. This change makes it work.
This commit is contained in:
Matthias Clasen 2014-05-08 01:17:35 -04:00
parent 08f2456d5f
commit 9b65955961
3 changed files with 4 additions and 2 deletions

View File

@ -81,7 +81,6 @@ get_property (GObject *object,
{
case PROP_WIDGET_TREE:
g_value_take_object (value, pl->priv->widget_tree);
g_object_set_data (G_OBJECT (pl->priv->value_renderer), "gtk_inspector-widget-tree", pl->priv->widget_tree);
break;
case PROP_CHILD_PROPERTIES:
@ -109,6 +108,7 @@ set_property (GObject *object,
{
case PROP_WIDGET_TREE:
pl->priv->widget_tree = g_value_get_object (value);
g_object_set_data (G_OBJECT (pl->priv->value_renderer), "gtk-inspector-widget-tree", pl->priv->widget_tree);
break;
case PROP_CHILD_PROPERTIES:

View File

@ -261,7 +261,7 @@ start_editing (GtkCellRenderer *renderer,
if (G_VALUE_HOLDS_OBJECT (&gvalue))
{
GtkInspectorWidgetTree *widget_tree = g_object_get_data (G_OBJECT (renderer), "gtk_inspector-widget-tree");
GtkInspectorWidgetTree *widget_tree = g_object_get_data (G_OBJECT (renderer), "gtk-inspector-widget-tree");
GObject *prop_object = g_value_get_object (&gvalue);
GtkTreeIter iter;

View File

@ -128,6 +128,7 @@
<object class="GtkInspectorPropList" id="prop_list">
<property name="visible">True</property>
<property name="child-properties">False</property>
<property name="widget-tree">widget_tree</property>
</object>
</child>
</object>
@ -149,6 +150,7 @@
<object class="GtkInspectorPropList" id="child_prop_list">
<property name="visible">True</property>
<property name="child-properties">True</property>
<property name="widget-tree">widget_tree</property>
</object>
</child>
</object>