Quick fix for #1081 #1096

Merged
g1itch merged 3 commits from ui-fixes into v0.6 2018-01-27 07:46:15 +01:00
Showing only changes of commit 6fca1631af - Show all commits

View File

@ -2784,9 +2784,13 @@ class MyForm(settingsmixin.SMainWindow):
tableWidget.item(currentRow, 1).setUnread(True) tableWidget.item(currentRow, 1).setUnread(True)
tableWidget.item(currentRow, 2).setUnread(True) tableWidget.item(currentRow, 2).setUnread(True)
tableWidget.item(currentRow, 3).setFont(font) tableWidget.item(currentRow, 3).setFont(font)
#sqlite requires the exact number of ?s to prevent injection # for 1081
rowcount = sqlExecute('''UPDATE inbox SET read=0 WHERE msgid IN (%s) AND read=1''' % ( idCount = len(inventoryHashesToMarkUnread)
"?," * len(inventoryHashesToMarkUnread))[:-1], *inventoryHashesToMarkUnread) rowcount = sqlExecuteChunked(
'''UPDATE inbox SET read=0 WHERE msgid IN ({0}) AND read=1''',
idCount, *inventoryHashesToMarkUnread
)
if rowcount == 1: if rowcount == 1:
# performance optimisation # performance optimisation
self.propagateUnreadCount(tableWidget.item(currentRow, 1 if tableWidget.item(currentRow, 1).type == AccountMixin.SUBSCRIPTION else 0).data(Qt.UserRole), self.getCurrentFolder()) self.propagateUnreadCount(tableWidget.item(currentRow, 1 if tableWidget.item(currentRow, 1).type == AccountMixin.SUBSCRIPTION else 0).data(Qt.UserRole), self.getCurrentFolder())