[pitivi] undo: Set LayerObserver fields before they are used



commit dceb0c89e4a20588f936594128da4a1e42012471
Author: Alexandru Băluț <alexandru balut gmail com>
Date:   Fri Jun 17 07:48:01 2016 +0200

    undo: Set LayerObserver fields before they are used
    
    A unittest would be big. The fields should be initialized at the
    beginning of the method anyway.

 pitivi/undo/timeline.py |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/pitivi/undo/timeline.py b/pitivi/undo/timeline.py
index dc15e8e..922f928 100644
--- a/pitivi/undo/timeline.py
+++ b/pitivi/undo/timeline.py
@@ -463,6 +463,9 @@ class LayerObserver(MetaContainerObserver, Loggable):
         self.action_log = action_log
         self.priority = ges_layer.props.priority
 
+        self.keyframe_observers = {}
+        self.track_element_observers = {}
+
         ges_layer.connect("clip-added", self._clipAddedCb)
         ges_layer.connect("clip-removed", self._clipRemovedCb)
         ges_layer.connect("notify::priority", self.__layer_moved_cb)
@@ -471,9 +474,6 @@ class LayerObserver(MetaContainerObserver, Loggable):
         for ges_clip in ges_layer.get_clips():
             self._connectToClip(ges_clip)
 
-        self.keyframe_observers = {}
-        self.track_element_observers = {}
-
     def _connectToClip(self, ges_clip):
         props = ["start", "duration", "in-point", "priority"]
         clip_observer = GObjectObserver(ges_clip, props, self.action_log)


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]