From bccc2406a25bf6c9e80a4043a361762593b44d3b Mon Sep 17 00:00:00 2001 From: mailchuck Date: Fri, 27 Nov 2015 16:53:05 +0100 Subject: [PATCH] Fix double unread count in tray icon --- src/bitmessageqt/__init__.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/bitmessageqt/__init__.py b/src/bitmessageqt/__init__.py index 324bd137..aa583e99 100644 --- a/src/bitmessageqt/__init__.py +++ b/src/bitmessageqt/__init__.py @@ -915,15 +915,15 @@ class MyForm(settingsmixin.SMainWindow): queryreturn = sqlQuery("SELECT COUNT(*) FROM inbox WHERE read = 0") for row in queryreturn: item.setUnreadCount(int(row[0])) - if isinstance(item, Ui_AddressWidget): + if isinstance(item, Ui_AddressWidget) and item.type == AccountMixin.ALL: self.drawTrayIcon(self.currentTrayIconFileName, self.findInboxUnreadCount()) elif type == 1: item.setUnreadCount(item.unreadCount + 1) - if isinstance(item, Ui_AddressWidget): + if isinstance(item, Ui_AddressWidget) and item.type == AccountMixin.ALL: self.drawTrayIcon(self.currentTrayIconFileName, self.findInboxUnreadCount(self.unreadCount + 1)) elif type == -1: item.setUnreadCount(item.unreadCount - 1) - if isinstance(item, Ui_AddressWidget): + if isinstance(item, Ui_AddressWidget) and item.type == AccountMixin.ALL: self.drawTrayIcon(self.currentTrayIconFileName, self.findInboxUnreadCount(self.unreadCount -1)) widgets = [self.ui.treeWidgetYourIdentities, self.ui.treeWidgetSubscriptions, self.ui.treeWidgetChans]