From db4fb87d68f6caca2ad48065a2760aed34b35c60 Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Fri, 5 Feb 2010 12:59:42 +0900 Subject: [PATCH] only update changed card ids after generating cards --- ankiqt/ui/cardlist.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ankiqt/ui/cardlist.py b/ankiqt/ui/cardlist.py index f27e97793..f1fe22f17 100644 --- a/ankiqt/ui/cardlist.py +++ b/ankiqt/ui/cardlist.py @@ -966,12 +966,13 @@ where id in %s""" % ids2str(sf)) facts = self.deck.s.query(Fact).filter( text("id in %s" % ids2str(sf))).order_by(Fact.created).all() self.deck.updateProgress(_("Generating Cards...")) + ids = [] for c, fact in enumerate(facts): - self.deck.addCards(fact, d.selectedCms) + ids.extend(self.deck.addCards(fact, d.selectedCms)) if c % 50 == 0: self.deck.updateProgress() self.deck.flushMod() - self.deck.updateAllPriorities() + self.deck.updatePriorities(ids) self.deck.finishProgress() self.parent.setProgressParent(None) self.deck.setUndoEnd(n)