don't prompt when no cards to remove; don't autodel on indiv. note edits

This commit is contained in:
Damien Elmes 2011-12-12 00:02:43 +09:00
parent 0b96e8a1a9
commit 428b6a0520
2 changed files with 7 additions and 2 deletions

View file

@ -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)

View file

@ -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)