mirror of
https://github.com/ankitects/anki.git
synced 2025-11-11 23:27:12 -05:00
add progress bar for deleting cards
This commit is contained in:
parent
4d4e7afcff
commit
d35320364a
1 changed files with 5 additions and 0 deletions
|
|
@ -1052,18 +1052,23 @@ where facts.id not in (select factId from cards)""")
|
|||
self.s.flush()
|
||||
now = time.time()
|
||||
strids = ids2str(ids)
|
||||
self.startProgress(3)
|
||||
# grab fact ids
|
||||
factIds = self.s.column0("select factId from cards where id in %s"
|
||||
% strids)
|
||||
# drop from cards
|
||||
self.updateProgress(_("Deleting cards..."))
|
||||
self.s.statement("delete from cards where id in %s" % strids)
|
||||
# note deleted
|
||||
self.updateProgress()
|
||||
data = [{'id': id, 'time': now} for id in ids]
|
||||
self.s.statements("insert into cardsDeleted values (:id, :time)", data)
|
||||
# remove any dangling facts
|
||||
self.updateProgress()
|
||||
self.deleteDanglingFacts()
|
||||
self.rebuildCounts()
|
||||
self.flushMod()
|
||||
self.finishProgress()
|
||||
|
||||
# Models
|
||||
##########################################################################
|
||||
|
|
|
|||
Loading…
Reference in a new issue