From 171a7647b916ee0c12d1494ba47921f3cd783c53 Mon Sep 17 00:00:00 2001 From: Emmanuele Bassi Date: Fri, 23 Jan 2009 16:22:02 +0000 Subject: [PATCH] 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. --- clutter/clutter-behaviour.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/clutter/clutter-behaviour.c b/clutter/clutter-behaviour.c index f4bdf546f..6cb543fba 100644 --- a/clutter/clutter-behaviour.c +++ b/clutter/clutter-behaviour.c @@ -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); } /**