diff --git a/anki/sched.py b/anki/sched.py index 2672c9144..a92befd86 100644 --- a/anki/sched.py +++ b/anki/sched.py @@ -19,7 +19,6 @@ class Scheduler(object): self.db = deck.db self.queueLimit = 200 self.reportLimit = 1000 - self.useGroups = True self._updateCutoff() def getCard(self): @@ -95,14 +94,16 @@ order by due""" % self._groupLimit(), def selCounts(self): "Return counts for selected groups, without building queue." - self.useGroups = True self._resetCounts() return self.counts() def allCounts(self): "Return counts for all groups, without building queue." - self.useGroups = False - self._resetCounts() + conf = self.deck.qconf['groups'] + if conf: + self.deck.qconf['groups'] = [] + self._resetCounts() + self.deck.qconf['groups'] = conf return self.counts() def _resetCounts(self): @@ -552,8 +553,6 @@ queue = 2 %s and due <= :lim order by %s limit %d""" % ( return self.confCache[id] def _groupLimit(self): - if not self.useGroups: - return "" l = self.deck.qconf['groups'] if not l: # everything diff --git a/tests/test_sched.py b/tests/test_sched.py index f8d49df5f..d3b1dc559 100644 --- a/tests/test_sched.py +++ b/tests/test_sched.py @@ -541,10 +541,6 @@ def test_counts(): d.qconf['groups'] = [1] d.reset() assert d.sched.counts() == (1,2,1) - # we can disable the groups without forgetting them - d.sched.useGroups = False - d.reset() - assert d.sched.counts() == (2,2,2) # we don't need to build the queue to get the counts assert d.sched.allCounts() == (2,2,2) assert d.sched.selCounts() == (1,2,1)