mirror of
https://github.com/ankitects/anki.git
synced 2025-09-22 07:52:24 -04:00
fix bug where two cards are selected after delete
This commit is contained in:
parent
ee6eaeeaa6
commit
8bef7da517
1 changed files with 4 additions and 4 deletions
|
@ -474,21 +474,21 @@ class EditDeck(QMainWindow):
|
|||
|
||||
def updateSearch(self, force=True):
|
||||
idx = self.dialog.tableView.currentIndex()
|
||||
row = idx.row()
|
||||
self.model.searchStr = unicode(self.dialog.filterEdit.text())
|
||||
self.model.showMatching(force)
|
||||
self.updateFilterLabel()
|
||||
self.onEvent()
|
||||
self.filterTimer = None
|
||||
if self.model.cards:
|
||||
if row == -1:
|
||||
row = 0
|
||||
self.dialog.cardInfoGroup.show()
|
||||
self.dialog.fieldsArea.show()
|
||||
self.dialog.tableView.selectionModel().setCurrentIndex(
|
||||
self.model.index(0, 0),
|
||||
QItemSelectionModel.Select | QItemSelectionModel.Rows)
|
||||
else:
|
||||
self.dialog.cardInfoGroup.hide()
|
||||
self.dialog.fieldsArea.hide()
|
||||
self.dialog.tableView.selectRow(idx.row())
|
||||
self.dialog.tableView.selectRow(row)
|
||||
self.dialog.tableView.scrollTo(idx, QAbstractItemView.PositionAtCenter)
|
||||
|
||||
def focusCurrentCard(self):
|
||||
|
|
Loading…
Reference in a new issue