mirror of
https://gitlab.linphone.org/BC/public/linphone-desktop.git
synced 2026-01-17 11:28:07 +00:00
Contacts fix on deletion
This commit is contained in:
parent
8fdf862a27
commit
91833adbae
4 changed files with 7 additions and 2 deletions
|
|
@ -100,6 +100,10 @@ QSharedPointer<ContactModel> ContactsListModel::findContactModelFromUsername (co
|
|||
}
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
ContactModel *ContactsListModel::getContactModelFromAddress (const QString& address) const{
|
||||
auto contact = findContactModelFromSipAddress(address);
|
||||
return contact.get();
|
||||
}
|
||||
|
||||
ContactModel *ContactsListModel::addContact (VcardModel *vcardModel) {
|
||||
// Try to merge vcardModel to an existing contact.
|
||||
|
|
|
|||
|
|
@ -49,6 +49,7 @@ public:
|
|||
QSharedPointer<ContactModel> findContactModelFromSipAddress (const QString &sipAddress) const;
|
||||
QSharedPointer<ContactModel> findContactModelFromUsername (const QString &username) const;
|
||||
|
||||
Q_INVOKABLE ContactModel *getContactModelFromAddress (const QString& address) const;
|
||||
Q_INVOKABLE ContactModel *addContact (VcardModel *vcardModel);
|
||||
Q_INVOKABLE void removeContact (ContactModel *contact);
|
||||
|
||||
|
|
|
|||
|
|
@ -79,7 +79,7 @@ function removeContact () {
|
|||
if (status) {
|
||||
window.unlockView()
|
||||
window.setView('Contacts')
|
||||
Linphone.ContactsListModel.remove(_contact)
|
||||
Linphone.ContactsListModel.removeContact(_contact)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@ ColumnLayout {
|
|||
Component.onDestruction: {_vcard=null}// Need to set it to null because of not calling destructor if not.
|
||||
Component.onCompleted:{
|
||||
var sipAddress = contactEdit.sipAddress
|
||||
var contact = contactEdit._contact = SipAddressesModel.mapSipAddressToContact(sipAddress)
|
||||
var contact = contactEdit._contact = ContactsListModel.getContactModelFromAddress(sipAddress)
|
||||
|
||||
if (!contact) {
|
||||
// Add a new contact.
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue