fix crash on friend update
This commit is contained in:
parent
db35d67a70
commit
f6c3fc3252
4 changed files with 12 additions and 13 deletions
|
|
@ -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) {
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
|
|
|
|||
|
|
@ -56,17 +56,16 @@ 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) {
|
||||
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() {
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in a new issue