From cd9a7b51574d6c863374a56602492c6fb30f2eb7 Mon Sep 17 00:00:00 2001 From: mailchuck Date: Thu, 19 Nov 2015 04:14:13 +0100 Subject: [PATCH] Missing folders in rerenderTabTreeSubscriptions I optimised it too much and sometimes folders were missing in the tree. --- src/bitmessageqt/__init__.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/bitmessageqt/__init__.py b/src/bitmessageqt/__init__.py index 82dfa5ef..2d591d9b 100644 --- a/src/bitmessageqt/__init__.py +++ b/src/bitmessageqt/__init__.py @@ -397,6 +397,10 @@ class MyForm(settingsmixin.SMainWindow): # init dictionary db = getSortedSubscriptions(True) + for address in db: + for folder in folders: + if not folder in db[address]: + db[address][folder] = {} if treeWidget.isSortingEnabled(): treeWidget.setSortingEnabled(False) @@ -432,7 +436,10 @@ class MyForm(settingsmixin.SMainWindow): if len(db[toAddress]) > 0: j = 0 for f, c in db[toAddress].iteritems(): - subwidget = Ui_FolderWidget(widget, j, toAddress, f, c['count']) + try: + subwidget = Ui_FolderWidget(widget, j, toAddress, f, c['count']) + except KeyError: + subwidget = Ui_FolderWidget(widget, j, toAddress, f, 0) j += 1 widget.setUnreadCount(unread) db.pop(toAddress, None)