script-parser: Be more strict with "children" members
The "children" member for Container definitions should only reference actors, and warn about any other type.
This commit is contained in:
@ -1669,6 +1669,18 @@ add_children (ClutterScript *script,
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!CLUTTER_IS_ACTOR (object))
|
||||||
|
{
|
||||||
|
g_warning ("The object definition '%s' (type: %s) is not "
|
||||||
|
"an actor, but it is referenced in the 'children' "
|
||||||
|
"member of the container '%s' (type: %s); skipping.",
|
||||||
|
child_info->id,
|
||||||
|
g_type_name (child_info->gtype),
|
||||||
|
oinfo->id,
|
||||||
|
g_type_name (oinfo->gtype));
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
CLUTTER_NOTE (SCRIPT, "Adding children '%s' to actor of type '%s'",
|
CLUTTER_NOTE (SCRIPT, "Adding children '%s' to actor of type '%s'",
|
||||||
name,
|
name,
|
||||||
g_type_name (G_OBJECT_TYPE (container)));
|
g_type_name (G_OBJECT_TYPE (container)));
|
||||||
|
Reference in New Issue
Block a user