diff --git a/Linphone/core/friend/FriendCore.cpp b/Linphone/core/friend/FriendCore.cpp index 2788c38f6..abd07a54d 100644 --- a/Linphone/core/friend/FriendCore.cpp +++ b/Linphone/core/friend/FriendCore.cpp @@ -100,6 +100,7 @@ FriendCore::FriendCore(const std::shared_ptr &contact) : QObje mStarred = false; } + mIsLdap = false; connect(this, &FriendCore::addressChanged, &FriendCore::allAddressesChanged); connect(this, &FriendCore::phoneNumberChanged, &FriendCore::allAddressesChanged); } @@ -116,6 +117,7 @@ FriendCore::FriendCore(const FriendCore &friendCore) { mJob = friendCore.mJob; mPictureUri = friendCore.mPictureUri; mIsSaved = friendCore.mIsSaved; + mIsLdap = friendCore.mIsLdap; } FriendCore::~FriendCore() { @@ -622,7 +624,7 @@ void FriendCore::save() { // Save Values to model (core->getDefaultFriendList()->addFriend(contact) == linphone::FriendList::Status::OK); if (created) { core->getDefaultFriendList()->updateSubscriptions(); - emit CoreModel::getInstance() -> friendCreated(contact); + emit CoreModel::getInstance()->friendCreated(contact); } mCoreModelConnection->invokeToCore([this, created]() { if (created) setSelf(mCoreModelConnection->mCore); @@ -655,6 +657,7 @@ bool FriendCore::getIsLdap() const { void FriendCore::setIsLdap(bool data) { if (mIsLdap != data) { mIsLdap = data; + emit readOnlyChanged(); } } diff --git a/Linphone/core/friend/FriendCore.hpp b/Linphone/core/friend/FriendCore.hpp index c053dbd33..3f36d0a63 100644 --- a/Linphone/core/friend/FriendCore.hpp +++ b/Linphone/core/friend/FriendCore.hpp @@ -67,7 +67,7 @@ class FriendCore : public QObject, public AbstractObject { Q_PROPERTY(bool isSaved READ getIsSaved NOTIFY isSavedChanged) Q_PROPERTY(QString pictureUri READ getPictureUri WRITE setPictureUri NOTIFY pictureUriChanged) Q_PROPERTY(bool starred READ getStarred WRITE lSetStarred NOTIFY starredChanged) - Q_PROPERTY(bool readOnly READ getReadOnly CONSTANT) + Q_PROPERTY(bool readOnly READ getReadOnly NOTIFY readOnlyChanged) public: // Should be call from model Thread. Will be automatically in App thread after initialization @@ -168,6 +168,7 @@ signals: void devicesChanged(); void verifiedDevicesChanged(); void lSetStarred(bool starred); + void readOnlyChanged(); protected: void writeIntoModel(std::shared_ptr model) const;