[pitivi] undo: Ignore noop track element property changes
- From: Alexandru Băluț <alexbalut src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [pitivi] undo: Ignore noop track element property changes
- Date: Thu, 26 Jan 2017 13:45:58 +0000 (UTC)
commit 5498fa834aecfaba82b105460dc000bb41460402
Author: Alexandru Băluț <alexandru balut gmail com>
Date: Tue Jan 3 10:44:30 2017 +0100
undo: Ignore noop track element property changes
Reviewed-by: Thibault Saunier <tsaunier gnome org>
Differential Revision: https://phabricator.freedesktop.org/D1581
pitivi/undo/timeline.py | 11 ++++++++++-
1 files changed, 10 insertions(+), 1 deletions(-)
---
diff --git a/pitivi/undo/timeline.py b/pitivi/undo/timeline.py
index c6823ca..16a00b8 100644
--- a/pitivi/undo/timeline.py
+++ b/pitivi/undo/timeline.py
@@ -55,6 +55,12 @@ class TrackElementPropertyChanged(UndoableAction):
self.old_value = old_value
self.new_value = new_value
+ def __repr__(self):
+ return "<TrackElementPropertyChanged %s.%s: %s -> %s>" % (self.track_element,
+ self.property_name,
+ self.old_value,
+ self.new_value)
+
def do(self):
self.track_element.set_child_property(
self.property_name, self.new_value)
@@ -72,7 +78,6 @@ class TrackElementPropertyChanged(UndoableAction):
isinstance(self.new_value, GObject.GEnum):
value = int(self.new_value)
st['value'] = value
-
return st
@@ -118,6 +123,10 @@ class TimelineElementObserver(Loggable):
old_value = self._properties[prop_name]
res, new_value = ges_timeline_element.get_child_property(prop_name)
assert res, prop_name
+ if old_value == new_value:
+ # Nothing to see here.
+ return
+
action = TrackElementPropertyChanged(
ges_timeline_element, prop_name, old_value, new_value)
self._properties[prop_name] = new_value
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]