[pitivi] undo: Fix transition clip observing
- From: Alexandru Băluț <alexbalut src gnome org>
- To: commits-list gnome org
- Cc: 
- Subject: [pitivi] undo: Fix transition clip observing
- Date: Fri, 24 Jun 2022 21:18:10 +0000 (UTC)
commit 6b7fd106e7c67cf84839bf1a78c77646eea568e1
Author: Alexandru Băluț <alexandru balut gmail com>
Date:   Tue May 31 11:47:31 2022 +0200
    undo: Fix transition clip observing
    
    When using get_toplevel_parent it's possible to get a GES.Group instead
    of a GES.TransitionClip which we need.
    
    Fixes #2580
 pitivi/undo/timeline.py | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)
---
diff --git a/pitivi/undo/timeline.py b/pitivi/undo/timeline.py
index 5dad27290..be9f9bd53 100644
--- a/pitivi/undo/timeline.py
+++ b/pitivi/undo/timeline.py
@@ -721,16 +721,14 @@ class LayerObserver(MetaContainerObserver, Loggable):
         action = ControlSourceRemoveAction(track_element, binding)
         self.action_log.push(action)
 
-    def _connect_to_track_element(self, track_element):
+    def _connect_to_track_element(self, track_element: GES.TrackElement):
         if isinstance(track_element, GES.VideoTransition):
-            ges_clip = track_element.get_toplevel_parent()
+            ges_clip = track_element.get_parent()
             ges_layer = ges_clip.props.layer
-            action = TransitionClipAddedAction(ges_layer, ges_clip,
-                                               track_element)
+            action = TransitionClipAddedAction(ges_layer, ges_clip, track_element)
             self.action_log.push(action)
 
-            observer = GObjectObserver(track_element, TRANSITION_PROPS,
-                                       self.action_log)
+            observer = GObjectObserver(track_element, TRANSITION_PROPS, self.action_log)
             self.track_element_observers[track_element] = observer
             return
 
[
Date Prev][
Date Next]   [
Thread Prev][
Thread Next]   
[
Thread Index]
[
Date Index]
[
Author Index]