From 428b6a0520e21b6f6d0955b49014b5103eaf1df4 Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Mon, 12 Dec 2011 00:02:43 +0900 Subject: [PATCH] don't prompt when no cards to remove; don't autodel on indiv. note edits --- anki/collection.py | 2 ++ anki/notes.py | 7 +++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/anki/collection.py b/anki/collection.py index fac6fe2f2..6cfa3a0a9 100644 --- a/anki/collection.py +++ b/anki/collection.py @@ -392,6 +392,8 @@ select id from notes where id in %s and id not in (select nid from cards)""" % self._remNotes(nids) def remEmptyCards(self, ids): + if not ids: + return if runFilter("remEmptyCards", len(ids), True): self.remCards(ids) diff --git a/anki/notes.py b/anki/notes.py index 25618c354..b1798edc5 100644 --- a/anki/notes.py +++ b/anki/notes.py @@ -157,5 +157,8 @@ insert or replace into notes values (?,?,?,?,?,?,?,?,?,?,?,?)""", def _postFlush(self): # generate missing cards if not self.newlyAdded: - ids = self.col.genCards([self.id]) - self.col.remEmptyCards(ids) + rem = self.col.genCards([self.id]) + # popping up a dialog while editing is confusing; instead we can + # document that the user should open the templates window to + # garbage collect empty cards + #self.col.remEmptyCards(ids)