[gtk+/gtk-2-24] Make GtkBuilder do not delay construct properties that can be resolved (so construct is respected wh
- From: Juan Pablo Ugarte <jpu src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/gtk-2-24] Make GtkBuilder do not delay construct properties that can be resolved (so construct is respected wh
- Date: Wed, 29 Jun 2011 15:14:06 +0000 (UTC)
commit a5b92540d039a3246db3f33842a363f3ce127c48
Author: Juan Pablo Ugarte <juanpablougarte gmail com>
Date: Wed Jun 29 11:45:33 2011 -0300
Make GtkBuilder do not delay construct properties that can be resolved
(so construct is respected when possible) and skip construct only props that
can not.
gtk/gtkbuilder.c | 20 ++++++++++----------
1 files changed, 10 insertions(+), 10 deletions(-)
---
diff --git a/gtk/gtkbuilder.c b/gtk/gtkbuilder.c
index a1ba56c..0ef6087 100644
--- a/gtk/gtkbuilder.c
+++ b/gtk/gtkbuilder.c
@@ -280,29 +280,29 @@ gtk_builder_get_parameters (GtkBuilder *builder,
if (G_IS_PARAM_SPEC_OBJECT (pspec) &&
(G_PARAM_SPEC_VALUE_TYPE (pspec) != GDK_TYPE_PIXBUF))
{
- if (pspec->flags & (G_PARAM_CONSTRUCT | G_PARAM_CONSTRUCT_ONLY))
+ GObject *object = gtk_builder_get_object (builder, prop->data);
+
+ if (object)
+ {
+ g_value_init (¶meter.value, G_OBJECT_TYPE (object));
+ g_value_set_object (¶meter.value, object);
+ }
+ else
{
- GObject *object;
- object = gtk_builder_get_object (builder, prop->data);
- if (!object)
+ if (pspec->flags & G_PARAM_CONSTRUCT_ONLY)
{
g_warning ("Failed to get constuct only property "
"%s of %s with value `%s'",
prop->name, object_name, prop->data);
continue;
}
- g_value_init (¶meter.value, G_OBJECT_TYPE (object));
- g_value_set_object (¶meter.value, object);
- }
- else
- {
+ /* Delay setting property */
property = g_slice_new (DelayedProperty);
property->object = g_strdup (object_name);
property->name = g_strdup (prop->name);
property->value = g_strdup (prop->data);
builder->priv->delayed_properties =
g_slist_prepend (builder->priv->delayed_properties, property);
-
continue;
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]