getCurrentFolder should return None on unavailable
I think None is better than False.
This commit is contained in:
parent
8862a88afa
commit
a59ea878b9
|
@ -1017,7 +1017,7 @@ class MyForm(QtGui.QMainWindow):
|
||||||
xAddress = "fromaddress"
|
xAddress = "fromaddress"
|
||||||
else:
|
else:
|
||||||
xAddress = "toaddress"
|
xAddress = "toaddress"
|
||||||
if folder != False:
|
if folder is not None:
|
||||||
sqlStatement = '''
|
sqlStatement = '''
|
||||||
SELECT folder, msgid, toaddress, fromaddress, subject, received, read
|
SELECT folder, msgid, toaddress, fromaddress, subject, received, read
|
||||||
FROM inbox WHERE ''' + xAddress + '''=? AND folder=? AND %s LIKE ?
|
FROM inbox WHERE ''' + xAddress + '''=? AND folder=? AND %s LIKE ?
|
||||||
|
@ -2350,7 +2350,7 @@ class MyForm(QtGui.QMainWindow):
|
||||||
inbox = self.getAccountMessagelist(acct)
|
inbox = self.getAccountMessagelist(acct)
|
||||||
treeWidget = self.getAccountTreeWidget(acct)
|
treeWidget = self.getAccountTreeWidget(acct)
|
||||||
self.propagateUnreadCount(acct.address)
|
self.propagateUnreadCount(acct.address)
|
||||||
if (self.getCurrentFolder(treeWidget) != "inbox" and self.getCurrentFolder(treeWidget) != False) or self.getCurrentAccount(treeWidget) != acct.address:
|
if (self.getCurrentFolder(treeWidget) != "inbox" and self.getCurrentFolder(treeWidget) is not None) or self.getCurrentAccount(treeWidget) != acct.address:
|
||||||
# Ubuntu should notify of new message irespective of whether it's in current message list or not
|
# Ubuntu should notify of new message irespective of whether it's in current message list or not
|
||||||
self.ubuntuMessagingMenuUpdate(True, None, acct.toLabel)
|
self.ubuntuMessagingMenuUpdate(True, None, acct.toLabel)
|
||||||
return
|
return
|
||||||
|
@ -3530,8 +3530,7 @@ class MyForm(QtGui.QMainWindow):
|
||||||
if currentItem and hasattr(currentItem, 'folderName'):
|
if currentItem and hasattr(currentItem, 'folderName'):
|
||||||
return currentItem.folderName
|
return currentItem.folderName
|
||||||
else:
|
else:
|
||||||
# TODO need debug msg?
|
return None
|
||||||
return False
|
|
||||||
|
|
||||||
def setCurrentItemColor(self, color):
|
def setCurrentItemColor(self, color):
|
||||||
treeWidget = self.getCurrentTreeWidget()
|
treeWidget = self.getCurrentTreeWidget()
|
||||||
|
@ -3697,7 +3696,7 @@ class MyForm(QtGui.QMainWindow):
|
||||||
tableWidget = self.getCurrentMessagelist()
|
tableWidget = self.getCurrentMessagelist()
|
||||||
if tableWidget:
|
if tableWidget:
|
||||||
currentFolder = self.getCurrentFolder()
|
currentFolder = self.getCurrentFolder()
|
||||||
if currentFolder == False:
|
if currentFolder is None:
|
||||||
pass
|
pass
|
||||||
if currentFolder == 'sent':
|
if currentFolder == 'sent':
|
||||||
self.on_context_menuSent(point)
|
self.on_context_menuSent(point)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user