mirror of
https://github.com/ankitects/anki.git
synced 2025-09-20 15:02:21 -04:00
fix updateCard() index error in editor
This commit is contained in:
parent
f8c80dc03d
commit
44e9859c53
1 changed files with 9 additions and 5 deletions
|
@ -150,11 +150,15 @@ class DeckModel(QAbstractTableModel):
|
|||
self.reset()
|
||||
|
||||
def updateCard(self, index):
|
||||
try:
|
||||
self.cards[index.row()] = self.deck.s.first("""
|
||||
select id, priority, question, answer, due, reps, factId
|
||||
from cards where id = :id""", id=self.cards[index.row()][0])
|
||||
self.emit(SIGNAL("dataChanged(QModelIndex,QModelIndex)"),
|
||||
index, self.index(index.row(), 1))
|
||||
except IndexError:
|
||||
# called after search changed
|
||||
pass
|
||||
|
||||
# Tools
|
||||
######################################################################
|
||||
|
|
Loading…
Reference in a new issue