Fix message content display after deleting/undeleting

This commit is contained in:
Peter Šurda 2018-01-28 16:13:07 +01:00
parent aabce6bab2
commit cc63c1270b
Signed by untrusted user: PeterSurda
GPG Key ID: 0C5F50C0B5F37D87

View File

@ -3001,6 +3001,7 @@ class MyForm(settingsmixin.SMainWindow):
continue continue
inventoryHashesToTrash.append(inventoryHashToTrash) inventoryHashesToTrash.append(inventoryHashToTrash)
currentRow = r.topRow() currentRow = r.topRow()
self.getCurrentMessageTextedit().setText("")
tableWidget.model().removeRows(r.topRow(), r.bottomRow()-r.topRow()+1) tableWidget.model().removeRows(r.topRow(), r.bottomRow()-r.topRow()+1)
idCount = len(inventoryHashesToTrash) idCount = len(inventoryHashesToTrash)
if folder == "trash" or shifted: if folder == "trash" or shifted:
@ -3010,7 +3011,6 @@ class MyForm(settingsmixin.SMainWindow):
sqlExecuteChunked('''UPDATE inbox SET folder='trash' WHERE msgid IN ({0})''', sqlExecuteChunked('''UPDATE inbox SET folder='trash' WHERE msgid IN ({0})''',
idCount, *inventoryHashesToTrash) idCount, *inventoryHashesToTrash)
tableWidget.selectRow(0 if currentRow == 0 else currentRow - 1) tableWidget.selectRow(0 if currentRow == 0 else currentRow - 1)
self.getCurrentMessageTextedit().setText("")
tableWidget.setUpdatesEnabled(True) tableWidget.setUpdatesEnabled(True)
self.propagateUnreadCount(self.getCurrentAccount, folder) self.propagateUnreadCount(self.getCurrentAccount, folder)
self.statusBar().showMessage(_translate( self.statusBar().showMessage(_translate(
@ -3032,6 +3032,7 @@ class MyForm(settingsmixin.SMainWindow):
continue continue
inventoryHashesToTrash.append(inventoryHashToTrash) inventoryHashesToTrash.append(inventoryHashToTrash)
currentRow = r.topRow() currentRow = r.topRow()
self.getCurrentMessageTextedit().setText("")
tableWidget.model().removeRows(r.topRow(), r.bottomRow()-r.topRow()+1) tableWidget.model().removeRows(r.topRow(), r.bottomRow()-r.topRow()+1)
if currentRow == 0: if currentRow == 0:
tableWidget.selectRow(currentRow) tableWidget.selectRow(currentRow)
@ -3041,7 +3042,6 @@ class MyForm(settingsmixin.SMainWindow):
sqlExecuteChunked('''UPDATE inbox SET folder='inbox' WHERE msgid IN({0})''', sqlExecuteChunked('''UPDATE inbox SET folder='inbox' WHERE msgid IN({0})''',
idCount, *inventoryHashesToTrash) idCount, *inventoryHashesToTrash)
tableWidget.selectRow(0 if currentRow == 0 else currentRow - 1) tableWidget.selectRow(0 if currentRow == 0 else currentRow - 1)
self.getCurrentMessageTextedit().setText("")
tableWidget.setUpdatesEnabled(True) tableWidget.setUpdatesEnabled(True)
self.propagateUnreadCount(self.getCurrentAccount) self.propagateUnreadCount(self.getCurrentAccount)
self.statusBar().showMessage(_translate( self.statusBar().showMessage(_translate(