[pitivi] undo: Remove unuseful code
- From: Alexandru Băluț <alexbalut src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [pitivi] undo: Remove unuseful code
- Date: Sat, 16 Apr 2016 14:24:16 +0000 (UTC)
commit fad9359dcc7938e0b7d8ba1c0d335976c872708e
Author: Alexandru Băluț <alexandru balut gmail com>
Date: Sun Apr 3 11:08:31 2016 +0200
undo: Remove unuseful code
_get_last_stack can never return None.
Differential Revision: https://phabricator.freedesktop.org/D862
pitivi/undo/undo.py | 13 ++++---------
1 files changed, 4 insertions(+), 9 deletions(-)
---
diff --git a/pitivi/undo/undo.py b/pitivi/undo/undo.py
index c63b917..ae28a9b 100644
--- a/pitivi/undo/undo.py
+++ b/pitivi/undo/undo.py
@@ -93,7 +93,6 @@ class UndoableActionStack(UndoableAction):
self.action_group_name = action_group_name
self.done_actions = []
self.undone_actions = []
- self.actions = []
self.finalizing_action = finalizing_action
def push(self, action):
@@ -175,7 +174,7 @@ class UndoableActionLog(GObject.Object, Loggable):
return
try:
- stack = self._getTopmostStack()
+ stack = self._get_last_stack()
except UndoWrongStateError as e:
self.debug("Ignore push because %s", e)
return
@@ -190,9 +189,7 @@ class UndoableActionLog(GObject.Object, Loggable):
return
self.debug("Rolling back")
- stack = self._getTopmostStack(pop=True)
- if stack is None:
- return
+ stack = self._get_last_stack(pop=True)
self.debug("rollback action group %s, nested %s",
stack.action_group_name, len(self.stacks))
self.emit("rollback", stack)
@@ -204,9 +201,7 @@ class UndoableActionLog(GObject.Object, Loggable):
return
self.debug("Committing")
- stack = self._getTopmostStack(pop=True)
- if stack is None:
- return
+ stack = self._get_last_stack(pop=True)
if not self.stacks:
self.undo_stacks.append(stack)
else:
@@ -265,7 +260,7 @@ class UndoableActionLog(GObject.Object, Loggable):
finally:
self.running = False
- def _getTopmostStack(self, pop=False):
+ def _get_last_stack(self, pop=False):
try:
if pop:
stack = self.stacks.pop(-1)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]