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 <[email protected]>
---
 clutter/clutter-animation.c |   11 ++++++-----
 1 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/clutter/clutter-animation.c b/clutter/clutter-animation.c
index 5cba385..204d5d7 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));
 }
 
 /**
-- 
1.6.0.4


-- 
To unsubscribe send a mail to [email protected]

Reply via email to