From 89752faceb496d64ad3272a95e71d590fcce400b Mon Sep 17 00:00:00 2001 From: mailchuck Date: Mon, 25 Jan 2016 23:52:11 +0100 Subject: [PATCH] Newly arrives messages sorting There could be cases where newly arrives message is not added correctly. It won't necessarily go to the top, that depends on the sort. --- src/bitmessageqt/__init__.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/bitmessageqt/__init__.py b/src/bitmessageqt/__init__.py index 3c5eaacc..41540fa9 100644 --- a/src/bitmessageqt/__init__.py +++ b/src/bitmessageqt/__init__.py @@ -975,9 +975,14 @@ class MyForm(settingsmixin.SMainWindow): updateUnreadCount(folderItem) def addMessageListItem(self, tableWidget, items): + sortingEnabled = tableWidget.isSortingEnabled() + if sortingEnabled: + tableWidget.setSortingEnabled(False) tableWidget.insertRow(0) for i in range(len(items)): tableWidget.setItem(0, i, items[i]) + if sortingEnabled: + tableWidget.setSortingEnabled(True) def addMessageListItemSent(self, tableWidget, toAddress, fromAddress, subject, status, ackdata, lastactiontime): acct = accountClass(fromAddress)