From 1d86f7a69925cc0800681da98447c0bd79361298 Mon Sep 17 00:00:00 2001 From: mailchuck Date: Fri, 23 Oct 2015 07:07:38 +0200 Subject: [PATCH] Put mailing lists behind normal accounts Fixes #58 --- src/bitmessageqt/foldertree.py | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/src/bitmessageqt/foldertree.py b/src/bitmessageqt/foldertree.py index 59e2b963..71caae66 100644 --- a/src/bitmessageqt/foldertree.py +++ b/src/bitmessageqt/foldertree.py @@ -132,16 +132,21 @@ class Ui_AddressWidget(QtGui.QTreeWidgetItem): reverse = False if self.treeWidget().header().sortIndicatorOrder() == QtCore.Qt.DescendingOrder: reverse = True - if shared.config.getboolean(self.address, 'enabled') == shared.config.getboolean(other.address, 'enabled'): - if shared.config.get(self.address, 'label'): - x = shared.config.get(self.address, 'label').decode('utf-8').lower() + if shared.config.getboolean(self.address, 'enabled') == \ + shared.config.getboolean(other.address, 'enabled'): + if shared.safeConfigGetBoolean(self.address, 'mailinglist') == \ + shared.safeConfigGetBoolean(other.address, 'mailinglist'): + if shared.config.get(self.address, 'label'): + x = shared.config.get(self.address, 'label').decode('utf-8').lower() + else: + x = self.address.decode('utf-8').lower() + if shared.config.get(other.address, 'label'): + y = shared.config.get(other.address, 'label').decode('utf-8').lower() + else: + y = other.address.decode('utf-8').lower() + return x < y else: - x = self.address.decode('utf-8').lower() - if shared.config.get(other.address, 'label'): - y = shared.config.get(other.address, 'label').decode('utf-8').lower() - else: - y = other.address.decode('utf-8').lower() - return x < y + return (reverse if shared.safeConfigGetBoolean(self.address, 'mailinglist') else not reverse) # else: return (not reverse if shared.config.getboolean(self.address, 'enabled') else reverse)