From 7b62094ea0d99484463b2242cacb6842a43157cd Mon Sep 17 00:00:00 2001 From: Houssam Salem Date: Mon, 26 May 2014 15:11:47 +1000 Subject: [PATCH 1/2] Add odid fix to db check (#1035) --- anki/collection.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/anki/collection.py b/anki/collection.py index 096507d37..c5b2a3e20 100644 --- a/anki/collection.py +++ b/anki/collection.py @@ -756,6 +756,17 @@ select id from cards where odue > 0 and (type=1 or queue=2) and not odid""") "Fixed %d cards with invalid properties.", cnt) % cnt) self.db.execute("update cards set odue=0 where id in "+ ids2str(ids)) + # cards with odid set when not in a dyn deck + dids = [id for id in self.decks.allIds() if not self.decks.isDyn(id)] + ids = self.db.list(""" +select id from cards where odid > 0 and did in %s""" % ids2str(dids)) + if ids: + cnt = len(ids) + problems.append( + ngettext("Fixed %d card with invalid properties.", + "Fixed %d cards with invalid properties.", cnt) % cnt) + self.db.execute("update cards set odid=0, odue=0 where id in "+ + ids2str(ids)) # tags self.tags.registerNotes() # field cache From 7fa346c2a27ae2075194e8cba17d2788f1dbe4bf Mon Sep 17 00:00:00 2001 From: Houssam Salem Date: Tue, 27 May 2014 07:04:10 +1000 Subject: [PATCH 2/2] Re-check favourites status on any text change Updates the favourites button when the search text is updated programmatically as well as user input. Fixes a bug where using the recent search drop-down doesn't update the favourites button state correctly. --- aqt/browser.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aqt/browser.py b/aqt/browser.py index dd1dde5db..8a4efd980 100644 --- a/aqt/browser.py +++ b/aqt/browser.py @@ -1763,7 +1763,7 @@ class FavouritesLineEdit(QLineEdit): # name of current saved filter (if query matches) self.name = None self.buttonClicked.connect(self.onClicked) - self.connect(self, SIGNAL("textEdited(QString)"), self.updateButton) + self.connect(self, SIGNAL("textChanged(QString)"), self.updateButton) def resizeEvent(self, event): buttonSize = self.button.sizeHint()