unbury cards when returning to deck list

This commit is contained in:
Damien Elmes 2012-10-23 19:48:35 +09:00
parent acae66d60e
commit 133d4c2e8e
3 changed files with 4 additions and 3 deletions

View file

@ -172,7 +172,7 @@ crt=?, mod=?, scm=?, dty=?, usn=?, ls=?, conf=?""",
def cleanup(self):
"Unsuspend any temporarily suspended cards."
if self.dty:
self.sched.onClose()
self.sched.unburyCards()
self.dty = False
def usn(self):

View file

@ -125,7 +125,7 @@ order by due""" % self._deckLimit(),
else:
return 3
def onClose(self):
def unburyCards(self):
"Unbury cards when closing."
self.col.db.execute(
"update cards set queue = type where queue = -2")
@ -189,6 +189,7 @@ order by due""" % self._deckLimit(),
"Returns [deckname, did, rev, lrn, new]"
self._checkDay()
self.col.decks.recoverOrphans()
self.unburyCards()
decks = self.col.decks.all()
decks.sort(key=itemgetter('name'))
lims = {}

View file

@ -486,7 +486,7 @@ def test_misc():
d.sched.buryNote(c.nid)
d.reset()
assert not d.sched.getCard()
d.sched.onClose()
d.sched.unburyCards()
d.reset()
assert d.sched.getCard()