[pitivi] timeline: Simplify dragEnd



commit 9018a0924dc9aa4a8a410f342599a859fc381383
Author: Alexandru Băluț <alexandru balut gmail com>
Date:   Fri Oct 2 14:42:01 2015 +0200

    timeline: Simplify dragEnd
    
    Reviewers: thiblahute
    
    Reviewed By: thiblahute
    
    Differential Revision: https://phabricator.freedesktop.org/D288

 pitivi/timeline/timeline.py |   11 +++++------
 1 files changed, 5 insertions(+), 6 deletions(-)
---
diff --git a/pitivi/timeline/timeline.py b/pitivi/timeline/timeline.py
index 8296a05..581b037 100644
--- a/pitivi/timeline/timeline.py
+++ b/pitivi/timeline/timeline.py
@@ -798,7 +798,7 @@ class Timeline(Gtk.EventBox, Zoomable, Loggable):
 
                 if zoom_was_fitted:
                     self.parent._setBestZoomRatio()
-                self.dragEnd(True)
+                self.dragEnd()
         else:
             success = False
 
@@ -1052,8 +1052,7 @@ class Timeline(Gtk.EventBox, Zoomable, Loggable):
 
     def __getDroppedLayer(self):
         """
-        Get the layer to which the clip should land, creating
-        layer as necessary.
+        Create the layer for a clip dropped on a separator.
         """
         priority = self._on_layer.props.priority
         if self.__on_separators[0] == self._on_layer.ui.after_sep:
@@ -1062,11 +1061,11 @@ class Timeline(Gtk.EventBox, Zoomable, Loggable):
         self.createLayer(max(0, priority))
         return self.bTimeline.get_layers()[priority]
 
-    def dragEnd(self, dropping=False):
-        if (self.draggingElement is not None and self.__got_dragged) or dropping:
+    def dragEnd(self):
+        if self.editing_context:
             self._snapEndedCb()
 
-            if self.__on_separators and not dropping:
+            if self.__on_separators and self.__got_dragged:
                 layer = self.__getDroppedLayer()
                 self.editing_context.editTo(self.editing_context.new_position,
                                             layer.get_priority())


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