diff --git a/Linphone/core/friend/FriendCore.cpp b/Linphone/core/friend/FriendCore.cpp index 3e3d3d0f..6b8d886b 100644 --- a/Linphone/core/friend/FriendCore.cpp +++ b/Linphone/core/friend/FriendCore.cpp @@ -566,7 +566,7 @@ void FriendCore::writeIntoModel(std::shared_ptr model) const { model->setJob(mJob); model->setPictureUri(mPictureUri); model->getFriend()->done(); - emit CoreModel::getInstance()->friendUpdated(model->getFriend()); + emit model->friendUpdated(); } void FriendCore::writeFromModel(const std::shared_ptr &model) { diff --git a/Linphone/model/core/CoreModel.hpp b/Linphone/model/core/CoreModel.hpp index 4a2fbed3..96a0a1dd 100644 --- a/Linphone/model/core/CoreModel.hpp +++ b/Linphone/model/core/CoreModel.hpp @@ -66,7 +66,6 @@ public: signals: void loggerInitialized(); void friendCreated(const std::shared_ptr &f); - void friendUpdated(const std::shared_ptr &f); void friendRemoved(const std::shared_ptr &f); void conferenceInfoCreated(const std::shared_ptr &confInfo); void unreadNotificationsChanged(); diff --git a/Linphone/model/friend/FriendModel.cpp b/Linphone/model/friend/FriendModel.cpp index ee8e00e6..e6a96b67 100644 --- a/Linphone/model/friend/FriendModel.cpp +++ b/Linphone/model/friend/FriendModel.cpp @@ -56,17 +56,16 @@ FriendModel::FriendModel(const std::shared_ptr &contact, const }; connect(this, &FriendModel::givenNameChanged, updateFullName); connect(this, &FriendModel::familyNameChanged, updateFullName); - connect(CoreModel::getInstance().get(), &CoreModel::friendUpdated, - [this](const std::shared_ptr &f) { - if (f == mMonitor) { - emit givenNameChanged(getGivenName()); - emit familyNameChanged(getFamilyName()); - emit organizationChanged(getOrganization()); - emit jobChanged(getJob()); - emit pictureUriChanged(getPictureUri()); - // emit starredChanged(getStarred()); // FriendCore do save() on change. Do not call it. - } - }); + connect(this, &FriendModel::friendUpdated, [this]() { + if (mMonitor) { + emit givenNameChanged(getGivenName()); + emit familyNameChanged(getFamilyName()); + emit organizationChanged(getOrganization()); + emit jobChanged(getJob()); + emit pictureUriChanged(getPictureUri()); + // emit starredChanged(getStarred()); // FriendCore do save() on change. Do not call it. + } + }); }; FriendModel::~FriendModel() { diff --git a/Linphone/model/friend/FriendModel.hpp b/Linphone/model/friend/FriendModel.hpp index 96151618..040f26de 100644 --- a/Linphone/model/friend/FriendModel.hpp +++ b/Linphone/model/friend/FriendModel.hpp @@ -98,6 +98,7 @@ signals: void organizationChanged(const QString &orga); void jobChanged(const QString &job); void presenceReceived(LinphoneEnums::ConsolidatedPresence consolidatedPresence, QDateTime presenceTimestamp); + void friendUpdated(); private: DECLARE_ABSTRACT_OBJECT