mirror of
https://github.com/ankitects/anki.git
synced 2025-09-20 23:12: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()
|
self.reset()
|
||||||
|
|
||||||
def updateCard(self, index):
|
def updateCard(self, index):
|
||||||
|
try:
|
||||||
self.cards[index.row()] = self.deck.s.first("""
|
self.cards[index.row()] = self.deck.s.first("""
|
||||||
select id, priority, question, answer, due, reps, factId
|
select id, priority, question, answer, due, reps, factId
|
||||||
from cards where id = :id""", id=self.cards[index.row()][0])
|
from cards where id = :id""", id=self.cards[index.row()][0])
|
||||||
self.emit(SIGNAL("dataChanged(QModelIndex,QModelIndex)"),
|
self.emit(SIGNAL("dataChanged(QModelIndex,QModelIndex)"),
|
||||||
index, self.index(index.row(), 1))
|
index, self.index(index.row(), 1))
|
||||||
|
except IndexError:
|
||||||
|
# called after search changed
|
||||||
|
pass
|
||||||
|
|
||||||
# Tools
|
# Tools
|
||||||
######################################################################
|
######################################################################
|
||||||
|
|
Loading…
Reference in a new issue