Fix selection after delete/undelete

This commit is contained in:
Peter Šurda 2018-01-28 12:48:25 +01:00
parent 08ac8a077b
commit aabce6bab2
Signed by untrusted user: PeterSurda
GPG Key ID: 0C5F50C0B5F37D87

View File

@ -3000,6 +3000,7 @@ class MyForm(settingsmixin.SMainWindow):
if inventoryHashToTrash in inventoryHashesToTrash:
continue
inventoryHashesToTrash.append(inventoryHashToTrash)
currentRow = r.topRow()
tableWidget.model().removeRows(r.topRow(), r.bottomRow()-r.topRow()+1)
idCount = len(inventoryHashesToTrash)
if folder == "trash" or shifted:
@ -3030,6 +3031,7 @@ class MyForm(settingsmixin.SMainWindow):
if inventoryHashToTrash in inventoryHashesToTrash:
continue
inventoryHashesToTrash.append(inventoryHashToTrash)
currentRow = r.topRow()
tableWidget.model().removeRows(r.topRow(), r.bottomRow()-r.topRow()+1)
if currentRow == 0:
tableWidget.selectRow(currentRow)