Fix: recurse prevention

In case something screws up, prevent recursive changes through
treeWidgetItemChagned
This commit is contained in:
mailchuck 2015-10-04 20:32:17 +02:00 committed by Peter Surda
parent 1cab8bf549
commit b8baceb629

View File

@ -587,6 +587,8 @@ class MyForm(QtGui.QMainWindow):
self.timer.start(2000) # milliseconds self.timer.start(2000) # milliseconds
QtCore.QObject.connect(self.timer, QtCore.SIGNAL("timeout()"), self.runEveryTwoSeconds) QtCore.QObject.connect(self.timer, QtCore.SIGNAL("timeout()"), self.runEveryTwoSeconds)
self.recurDepth = 0
self.init_file_menu() self.init_file_menu()
self.init_inbox_popup_menu() self.init_inbox_popup_menu()
self.init_identities_popup_menu() self.init_identities_popup_menu()
@ -3489,9 +3491,15 @@ more work your computer must do to send the message. A Time-To-Live of four or f
if newLabel == oldLabel: if newLabel == oldLabel:
return return
# recursion prevention
if self.recurDepth > 0:
return
self.recurDepth += 1
shared.config.set(str(item.address), 'label', newLabel) shared.config.set(str(item.address), 'label', newLabel)
item.updateText() item.updateText()
shared.writeKeysFile() shared.writeKeysFile()
self.recurDepth -= 1
def tableWidgetInboxItemClicked(self): def tableWidgetInboxItemClicked(self):
folder = self.getCurrentFolder() folder = self.getCurrentFolder()