Commit 6e6b42bd authored by Luci Stanescu's avatar Luci Stanescu

Fixed sending of signals in ContactModel when contacts are added/updated

parent 5f0a055e
...@@ -1193,7 +1193,7 @@ class ContactModel(QAbstractListModel): ...@@ -1193,7 +1193,7 @@ class ContactModel(QAbstractListModel):
def addContact(self, contact): def addContact(self, contact):
if contact in self.items: if contact in self.items:
return return
added_items = [contact.group, contact] if contact.group in self.items else [contact] added_items = [contact] if contact.group in self.items else [contact.group, contact]
self._add_contact(contact) self._add_contact(contact)
self.itemsAdded.emit(added_items) self.itemsAdded.emit(added_items)
...@@ -1209,9 +1209,8 @@ class ContactModel(QAbstractListModel): ...@@ -1209,9 +1209,8 @@ class ContactModel(QAbstractListModel):
self._add_contact(contact) self._add_contact(contact)
if new_group: if new_group:
self.itemsAdded.emit([group]) self.itemsAdded.emit([group])
else: index = self.index(self.items.index(contact))
index = self.index(self.items.index(contact)) self.dataChanged.emit(index, index)
self.dataChanged.emit(index, index)
@updates_contacts_db @updates_contacts_db
def removeContact(self, contact): def removeContact(self, contact):
......
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