fix crash on friend update

This commit is contained in:
Gaelle Braud 2025-01-10 10:30:24 +01:00
parent db35d67a70
commit f6c3fc3252
4 changed files with 12 additions and 13 deletions

View file

@ -566,7 +566,7 @@ void FriendCore::writeIntoModel(std::shared_ptr<FriendModel> 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<FriendModel> &model) {

View file

@ -66,7 +66,6 @@ public:
signals:
void loggerInitialized();
void friendCreated(const std::shared_ptr<linphone::Friend> &f);
void friendUpdated(const std::shared_ptr<linphone::Friend> &f);
void friendRemoved(const std::shared_ptr<linphone::Friend> &f);
void conferenceInfoCreated(const std::shared_ptr<linphone::ConferenceInfo> &confInfo);
void unreadNotificationsChanged();

View file

@ -56,9 +56,8 @@ FriendModel::FriendModel(const std::shared_ptr<linphone::Friend> &contact, const
};
connect(this, &FriendModel::givenNameChanged, updateFullName);
connect(this, &FriendModel::familyNameChanged, updateFullName);
connect(CoreModel::getInstance().get(), &CoreModel::friendUpdated,
[this](const std::shared_ptr<linphone::Friend> &f) {
if (f == mMonitor) {
connect(this, &FriendModel::friendUpdated, [this]() {
if (mMonitor) {
emit givenNameChanged(getGivenName());
emit familyNameChanged(getFamilyName());
emit organizationChanged(getOrganization());

View file

@ -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