Bug 1395 - apply and get_nth_actor are inconsistent

When calling clutter_behaviour_apply() the new actor is prepended
to the list of actors to which a behaviour is applied; this breaks
the rest of methods working on the actors list, e.g.:

  # adding actors
  apply(actor_0);
  apply(actor_1);
  apply(actor_2);

  # expected: [ actor_0, actor_1, actor_2 ]
  [ actor_2, actor_1, actor_0 ] = get_actors();

  # expected: actor_2
  actor_0 = get_nth_actor(2);

This commit fixes the inconsistency in the returned values.
This commit is contained in:
Emmanuele Bassi 2009-01-23 16:22:02 +00:00
parent ba068f6bc9
commit 171a7647b9

View File

@ -362,7 +362,7 @@ clutter_behaviour_apply (ClutterBehaviour *behave,
return;
}
priv->actors = g_slist_prepend (priv->actors, g_object_ref (actor));
priv->actors = g_slist_append (priv->actors, g_object_ref (actor));
g_signal_connect (actor, "destroy",
G_CALLBACK (remove_actor_on_destroy),
behave);
@ -627,7 +627,7 @@ clutter_behaviour_get_actors (ClutterBehaviour *behave)
for (l = priv->actors; l != NULL; l = l->next)
retval = g_slist_prepend (retval, l->data);
return retval;
return g_slist_reverse (retval);
}
/**