Drop some more ClutterContainer.get_children() uses

This commit is contained in:
Emmanuele Bassi 2011-12-18 22:35:45 +00:00
parent ec6873958b
commit ab429f4f45
2 changed files with 12 additions and 18 deletions

View File

@ -156,13 +156,12 @@
* ClutterAllocationFlags flags) * ClutterAllocationFlags flags)
* { * {
* MyLayoutManager *self = MY_LAYOUT_MANAGER (manager); * MyLayoutManager *self = MY_LAYOUT_MANAGER (manager);
* GList *children, *l; * ClutterActor *child;
* *
* children = clutter_container_get_children (container); * for (child = clutter_actor_get_first_child (CLUTTER_ACTOR (container));
* * child != NULL;
* for (l = children; l != NULL; l = l->next) * child = clutter_actor_get_next_sibling (child))
* { * {
* ClutterActor *child = l->data;
* ClutterLayoutMeta *meta; * ClutterLayoutMeta *meta;
* MyLayoutMeta *my_meta; * MyLayoutMeta *my_meta;
* *
@ -223,8 +222,6 @@
* /* allocate the child */ * /* allocate the child */
* clutter_actor_allocate (child, &child_box, flags); * clutter_actor_allocate (child, &child_box, flags);
* } * }
*
* g_list_free (children);
* } * }
* </programlisting> * </programlisting>
* </example> * </example>

View File

@ -1832,20 +1832,19 @@ _clutter_script_check_unresolved (ClutterScript *script,
ClutterActor *parent; ClutterActor *parent;
parent = clutter_actor_get_parent (CLUTTER_ACTOR (oinfo->object)); parent = clutter_actor_get_parent (CLUTTER_ACTOR (oinfo->object));
if (parent != NULL && CLUTTER_IS_CONTAINER (parent)) if (parent != NULL)
{ {
ClutterContainer *container = CLUTTER_CONTAINER (parent); ClutterContainer *container = CLUTTER_CONTAINER (parent);
GList *children, *l; ClutterActor *child;
children = clutter_container_get_children (container); for (child = clutter_actor_get_first_child (parent);
child != NULL;
for (l = children; l != NULL; l = l->next) child = clutter_actor_get_next_sibling (child))
{ {
GObject *child = l->data;
ObjectInfo *child_info; ObjectInfo *child_info;
const gchar *id_; const gchar *id_;
id_ = clutter_get_script_id (child); id_ = clutter_get_script_id (G_OBJECT (child));
if (id_ == NULL || *id_ == '\0') if (id_ == NULL || *id_ == '\0')
continue; continue;
@ -1854,14 +1853,12 @@ _clutter_script_check_unresolved (ClutterScript *script,
continue; continue;
apply_child_properties (script, container, apply_child_properties (script, container,
CLUTTER_ACTOR (child), child,
child_info); child_info);
apply_layout_properties (script, container, apply_layout_properties (script, container,
CLUTTER_ACTOR (child), child,
child_info); child_info);
} }
g_list_free (children);
} }
} }