Edit book: Fix an error that occurs if more than 100 checkpoints are created. Fixes #1282583 [book editor error when adding 100 items](https://bugs.launchpad.net/calibre/+bug/1282583)

This commit is contained in:
Kovid Goyal 2014-02-20 21:13:09 +05:30
parent 526e7882bb
commit 15c3a466e5

View File

@ -108,6 +108,7 @@ class GlobalUndoHistory(QAbstractListModel):
self.beginRemoveRows(ROOT, 0, num - 1) self.beginRemoveRows(ROOT, 0, num - 1)
cleanup(self.states[:num]) cleanup(self.states[:num])
self.states = self.states[num:] self.states = self.states[num:]
self.pos -= num
self.endRemoveRows() self.endRemoveRows()
def rewind_savepoint(self): def rewind_savepoint(self):