From 94d5eeb16f5e4a398010b4d40f03af674bdd23ec Mon Sep 17 00:00:00 2001 From: mailchuck Date: Thu, 28 Apr 2016 10:12:06 +0200 Subject: [PATCH] Unread count fixes --- src/bitmessageqt/__init__.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/bitmessageqt/__init__.py b/src/bitmessageqt/__init__.py index 2feafb31..e166577b 100644 --- a/src/bitmessageqt/__init__.py +++ b/src/bitmessageqt/__init__.py @@ -531,7 +531,8 @@ class MyForm(settingsmixin.SMainWindow): subwidget = widget.child(j) try: subwidget.setUnreadCount(db[toAddress][subwidget.folderName]) - unread += db[toAddress][subwidget.folderName] + if subwidget.folderName not in ["new", "trash", "sent"]: + unread += db[toAddress][subwidget.folderName] db[toAddress].pop(subwidget.folderName, None) except: widget.takeChild(j) @@ -544,6 +545,8 @@ class MyForm(settingsmixin.SMainWindow): j = 0 for f, c in db[toAddress].iteritems(): subwidget = Ui_FolderWidget(widget, j, toAddress, f, c) + if subwidget.folderName not in ["new", "trash", "sent"]: + unread += c j += 1 widget.setUnreadCount(unread) db.pop(toAddress, None) @@ -558,7 +561,8 @@ class MyForm(settingsmixin.SMainWindow): if toAddress is not None and folder == "new": continue subwidget = Ui_FolderWidget(widget, j, toAddress, folder, db[toAddress][folder]) - unread += db[toAddress][folder] + if subwidget.folderName not in ["new", "trash", "sent"]: + unread += db[toAddress][folder] j += 1 widget.setUnreadCount(unread) i += 1