[pitivi] undo: Avoid passing the object when disconnecting
- From: Alexandru Băluț <alexbalut src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [pitivi] undo: Avoid passing the object when disconnecting
- Date: Mon, 23 May 2016 08:38:28 +0000 (UTC)
commit 843a5adb3fcf2b6ac6c99bdd8972c1b018803efd
Author: Alexandru Băluț <alexandru balut gmail com>
Date: Wed May 4 16:44:11 2016 +0200
undo: Avoid passing the object when disconnecting
Also rename disconnectFromObject to release.
Differential Revision: https://phabricator.freedesktop.org/D989
pitivi/undo/timeline.py | 12 ++++++------
pitivi/undo/undo.py | 4 ++--
2 files changed, 8 insertions(+), 8 deletions(-)
---
diff --git a/pitivi/undo/timeline.py b/pitivi/undo/timeline.py
index 2c410ba..3f5b7d6 100644
--- a/pitivi/undo/timeline.py
+++ b/pitivi/undo/timeline.py
@@ -233,9 +233,9 @@ class ClipPropertyChangeTracker(PropertyChangeTracker):
self.timeline = ges_clip.timeline
self.timeline.connect("commited", self._timelineCommitedCb)
- def disconnectFromObject(self, obj):
+ def release(self):
self.timeline.disconnect_by_func(self._timelineCommitedCb)
- PropertyChangeTracker.disconnectFromObject(self, obj)
+ PropertyChangeTracker.release(self)
def _timelineCommitedCb(self, timeline):
properties = self._takeCurrentSnapshot(self.gobject)
@@ -271,9 +271,9 @@ class KeyframeChangeTracker(GObject.Object):
return keyframes
- def disconnectFromObject(self, control_source):
+ def release(self):
+ self.control_source.disconnect_by_func(self._keyframeMovedCb)
self.control_source = None
- control_source.disconnect_by_func(self._keyframeMovedCb)
def _keyframeAddedCb(self, control_source, keyframe):
self.keyframes[keyframe.timestamp] = self._getKeyframeSnapshot(keyframe)
@@ -604,7 +604,7 @@ class TimelineObserver(Loggable):
clip.disconnect_by_func(self._clipTrackElementAddedCb)
clip.disconnect_by_func(self._clipTrackElementRemovedCb)
tracker = self.clip_property_trackers.pop(clip)
- tracker.disconnectFromObject(clip)
+ tracker.release()
tracker.disconnect_by_func(self._clipPropertyChangedCb)
def _controlBindingAddedCb(self, track_element, binding):
@@ -662,7 +662,7 @@ class TimelineObserver(Loggable):
try:
tracker = self.control_source_keyframe_trackers.pop(control_source)
- tracker.disconnectFromObject(control_source)
+ tracker.release()
tracker.disconnect_by_func(self._controlSourceKeyFrameMovedCb)
except KeyError:
self.debug("Control source already disconnected: %s" % control_source)
diff --git a/pitivi/undo/undo.py b/pitivi/undo/undo.py
index 63dce16..a310a95 100644
--- a/pitivi/undo/undo.py
+++ b/pitivi/undo/undo.py
@@ -374,9 +374,9 @@ class PropertyChangeTracker(GObject.Object):
return properties
- def disconnectFromObject(self, obj):
+ def release(self):
+ self.gobject.disconnect_by_func(self._propertyChangedCb)
self.gobject = None
- obj.disconnect_by_func(self._propertyChangedCb)
def _propertyChangedCb(self, gobject, property_value, property_name):
old_value = self.properties[property_name]
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]