script: Always allow setting object properties by id reference

The block that allows setting a GObject property holding an object
instance is conditionally depending on the USE_PIXBUF define. This
makes it impossible to reference an object inside ClutterScript on
platforms not using GdkPixbuf.
This commit is contained in:
Emmanuele Bassi 2009-10-21 15:17:50 +01:00
parent ef8ae7d72f
commit 50aec3c540

View File

@ -1103,21 +1103,25 @@ clutter_script_parse_node (ClutterScript *script,
g_free (path);
}
}
else
#endif
if (G_VALUE_HOLDS (&node_value, G_TYPE_STRING))
{
if (G_VALUE_HOLDS (&node_value, G_TYPE_STRING))
const gchar *str = g_value_get_string (&node_value);
GObject *object = clutter_script_get_object (script, str);
if (object)
{
const gchar *str = g_value_get_string (&node_value);
GObject *object = clutter_script_get_object (script, str);
if (object)
{
g_value_set_object (value, object);
retval = TRUE;
}
CLUTTER_NOTE (SCRIPT,
"Assigning '%s' (%s) to property '%s'",
str,
G_OBJECT_TYPE_NAME (object),
name);
g_value_set_object (value, object);
retval = TRUE;
}
}
break;
#endif
default:
retval = FALSE;
@ -1179,6 +1183,7 @@ clutter_script_translate_parameters (ClutterScript *script,
if (!res)
{
CLUTTER_NOTE (SCRIPT, "Property '%s' ignored", pinfo->name);
unparsed = g_list_prepend (unparsed, pinfo);
continue;
}