mirror of
https://github.com/ankitects/anki.git
synced 2025-09-24 08:46:37 -04:00
reset undo on check db
This commit is contained in:
parent
440321459a
commit
9eca0221f1
1 changed files with 6 additions and 0 deletions
|
@ -1895,6 +1895,7 @@ Return new path, relative to media dir."""
|
|||
|
||||
def fixIntegrity(self):
|
||||
"Responsibility of caller to call rebuildQueue()"
|
||||
self.resetUndo()
|
||||
self.startProgress(12)
|
||||
self.updateProgress(_("Checking integrity..."))
|
||||
if self.s.scalar("pragma integrity_check") != "ok":
|
||||
|
@ -2088,6 +2089,11 @@ insert into undoLog values (null, 'insert into %(t)s (rowid""" % {'t': table}
|
|||
def redoAvailable(self):
|
||||
return self.undoEnabled and self.redoStack
|
||||
|
||||
def resetUndo(self):
|
||||
self.s.statement("delete from undoLog")
|
||||
self.undoStack = []
|
||||
self.redoStack = []
|
||||
|
||||
def setUndoBarrier(self):
|
||||
if not self.undoStack or self.undoStack[-1] is not None:
|
||||
self.undoStack.append(None)
|
||||
|
|
Loading…
Reference in a new issue