Skip to content

Commit

Permalink
Message list loading performance improvement
Browse files Browse the repository at this point in the history
- by disabling UI updates (which are not necessary as it freezes
  anyway), the message list loading is faster
  • Loading branch information
PeterSurda committed Oct 21, 2016
1 parent 47e2df8 commit 9dd09a4
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/bitmessageqt/__init__.py
Expand Up @@ -1091,6 +1091,7 @@ def loadSent(self, tableWidget, account, where="", what=""):
tableWidget.setColumnHidden(1, True)
xAddress = 'fromaddress'

tableWidget.setUpdatesEnabled(False)
tableWidget.setSortingEnabled(False)
tableWidget.setRowCount(0)
queryreturn = helper_search.search_sql(xAddress, account, "sent", where, what, False)
Expand All @@ -1102,6 +1103,7 @@ def loadSent(self, tableWidget, account, where="", what=""):
tableWidget.setSortingEnabled(False)
tableWidget.horizontalHeader().setSortIndicator(3, Qt.DescendingOrder)
tableWidget.horizontalHeaderItem(3).setText(_translate("MainWindow", "Sent", None))
tableWidget.setUpdatesEnabled(True)

# Load messages from database file
def loadMessagelist(self, tableWidget, account, folder="inbox", where="", what="", unreadOnly = False):
Expand All @@ -1120,6 +1122,7 @@ def loadMessagelist(self, tableWidget, account, folder="inbox", where="", what="
tableWidget.setColumnHidden(0, False)
tableWidget.setColumnHidden(1, False)

tableWidget.setUpdatesEnabled(False)
tableWidget.setSortingEnabled(False)
tableWidget.setRowCount(0)

Expand All @@ -1133,6 +1136,7 @@ def loadMessagelist(self, tableWidget, account, folder="inbox", where="", what="
tableWidget.setSortingEnabled(True)
tableWidget.selectRow(0)
tableWidget.horizontalHeaderItem(3).setText(_translate("MainWindow", "Received", None))
tableWidget.setUpdatesEnabled(True)

# create application indicator
def appIndicatorInit(self, app):
Expand Down

0 comments on commit 9dd09a4

Please sign in to comment.