Commit 9ec0b88e authored by Dan Pascu's avatar Dan Pascu

Fixed exceptions when an account is removed while active

parent 0fa97fa1
......@@ -119,22 +119,34 @@ class AccountModel(QAbstractListModel):
self.endRemoveRows()
def _NH_SIPAccountWillRegister(self, notification):
try:
position = self.accounts.index(notification.sender)
except ValueError:
return
self.accounts[position].registration_state = 'started'
self.dataChanged.emit(self.index(position), self.index(position))
def _NH_SIPAccountRegistrationDidSucceed(self, notification):
try:
position = self.accounts.index(notification.sender)
except ValueError:
return
self.accounts[position].registration_state = 'succeeded'
self.dataChanged.emit(self.index(position), self.index(position))
def _NH_SIPAccountRegistrationDidFail(self, notification):
try:
position = self.accounts.index(notification.sender)
except ValueError:
return
self.accounts[position].registration_state = 'failed'
self.dataChanged.emit(self.index(position), self.index(position))
def _NH_SIPAccountRegistrationDidEnd(self, notification):
try:
position = self.accounts.index(notification.sender)
except ValueError:
return
self.accounts[position].registration_state = 'ended'
self.dataChanged.emit(self.index(position), self.index(position))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment