From 1187972e45b8c64ad25c2a243b0112bbde84e3e6 Mon Sep 17 00:00:00 2001 From: Jonas Bonn Date: Thu, 28 May 2009 09:40:09 +0200 Subject: [PATCH] [animation] Final cleanups to new Animation model Just a couple of final cleanups after the reimplementation of the Animation model. i) _set_mode does not need to set the timeline on the alpha ii) freeze notifications around the setting of a new alpha Signed-off-by: Jonas Bonn Signed-off-by: Emmanuele Bassi --- clutter/clutter-animation.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/clutter/clutter-animation.c b/clutter/clutter-animation.c index d1bd5b830..9fbb71f20 100644 --- a/clutter/clutter-animation.c +++ b/clutter/clutter-animation.c @@ -1018,7 +1018,6 @@ void clutter_animation_set_mode (ClutterAnimation *animation, gulong mode) { - ClutterTimeline *timeline; ClutterAlpha *alpha; g_return_if_fail (CLUTTER_IS_ANIMATION (animation)); @@ -1028,9 +1027,6 @@ clutter_animation_set_mode (ClutterAnimation *animation, alpha = clutter_animation_get_alpha_internal (animation); clutter_alpha_set_mode (alpha, mode); - timeline = clutter_animation_get_timeline_internal (animation); - clutter_alpha_set_timeline (alpha, timeline); - g_object_notify (G_OBJECT (animation), "mode"); g_object_thaw_notify (G_OBJECT (animation)); @@ -1267,6 +1263,8 @@ clutter_animation_set_alpha (ClutterAnimation *animation, if (priv->alpha == alpha) return; + g_object_freeze_notify (G_OBJECT (animation)); + if (priv->alpha != NULL) timeline = clutter_alpha_get_timeline (priv->alpha); else @@ -1300,7 +1298,7 @@ clutter_animation_set_alpha (ClutterAnimation *animation, } if (alpha == NULL) - return; + goto out; priv->alpha = g_object_ref_sink (alpha); priv->alpha_notify_id = @@ -1324,12 +1322,15 @@ clutter_animation_set_alpha (ClutterAnimation *animation, else timeline = clutter_animation_get_timeline_internal (animation); +out: /* emit all relevant notifications */ g_object_notify (G_OBJECT (animation), "mode"); g_object_notify (G_OBJECT (animation), "duration"); g_object_notify (G_OBJECT (animation), "loop"); g_object_notify (G_OBJECT (animation), "alpha"); g_object_notify (G_OBJECT (animation), "timeline"); + + g_object_thaw_notify (G_OBJECT (animation)); } /**