[pitivi] elements: Remove small methods



commit f8cbbbeecd164c16aef19841b689f29a010c890c
Author: Alexandru Băluț <alexandru balut gmail com>
Date:   Thu Oct 22 16:21:08 2015 +0200

    elements: Remove small methods
    
    Differential Revision: https://phabricator.freedesktop.org/D435

 pitivi/timeline/elements.py |   32 ++++++++++++++------------------
 1 files changed, 14 insertions(+), 18 deletions(-)
---
diff --git a/pitivi/timeline/elements.py b/pitivi/timeline/elements.py
index 5ac5ea9..55340e8 100644
--- a/pitivi/timeline/elements.py
+++ b/pitivi/timeline/elements.py
@@ -612,7 +612,9 @@ class Clip(Gtk.EventBox, timelineUtils.Zoomable, Loggable):
         timelineUtils.Zoomable.__init__(self)
         Loggable.__init__(self)
 
-        self.set_name(bClip.get_name())
+        name = bClip.get_name()
+        self.set_name(name)
+        self.get_accessible().set_name(name)
 
         self.handles = []
         self.z_order = -1
@@ -634,14 +636,21 @@ class Clip(Gtk.EventBox, timelineUtils.Zoomable, Loggable):
             self._childAdded(self.bClip, child)
             self.__connectToChild(child)
 
-        self._connectWidgetSignals()
+        # Connect to Widget signals.
+        self.connect("button-release-event", self.__buttonReleaseEventCb)
+        self.connect("event", self._eventCb)
 
-        self._connectGES()
-        self.get_accessible().set_name(self.bClip.get_name())
+        # Connect to GES signals.
+        self.bClip.connect("notify::start", self._startChangedCb)
+        self.bClip.connect("notify::inpoint", self._startChangedCb)
+        self.bClip.connect("notify::duration", self._durationChangedCb)
+        self.bClip.connect("notify::layer", self._layerChangedCb)
+
+        self.bClip.connect_after("child-added", self._childAddedCb)
+        self.bClip.connect_after("child-removed", self._childRemovedCb)
 
         # To be able to receive effects dragged on clips.
         self.drag_dest_set(0, [ui.EFFECT_TARGET_ENTRY], Gdk.DragAction.COPY)
-
         self.connect("drag-drop", self.__dragDropCb)
 
     def __dragDropCb(self, unused_widget, context, x, y, timestamp):
@@ -774,10 +783,6 @@ class Clip(Gtk.EventBox, timelineUtils.Zoomable, Loggable):
 
         return False
 
-    def _connectWidgetSignals(self):
-        self.connect("button-release-event", self.__buttonReleaseEventCb)
-        self.connect("event", self._eventCb)
-
     def release(self):
         for child in self.bClip.get_children(True):
             self.__disconnectFromChild(child)
@@ -849,15 +854,6 @@ class Clip(Gtk.EventBox, timelineUtils.Zoomable, Loggable):
         self.__disconnectFromChild(child)
         self._childRemoved(clip, child)
 
-    def _connectGES(self):
-        self.bClip.connect("notify::start", self._startChangedCb)
-        self.bClip.connect("notify::inpoint", self._startChangedCb)
-        self.bClip.connect("notify::duration", self._durationChangedCb)
-        self.bClip.connect("notify::layer", self._layerChangedCb)
-
-        self.bClip.connect_after("child-added", self._childAddedCb)
-        self.bClip.connect_after("child-removed", self._childRemovedCb)
-
 
 class SourceClip(Clip):
     __gtype_name__ = "PitiviSourceClip"


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