fix(src/components/call/CallModel): do not set data model twice

This commit is contained in:
Ronan Abhamon 2017-04-19 10:53:41 +02:00
parent a19d292bf5
commit 7c92738cd7
3 changed files with 5 additions and 3 deletions

View file

@ -108,6 +108,10 @@ CallModel::CallModel (shared_ptr<linphone::Call> linphoneCall) {
);
}
CallModel::~CallModel () {
mLinphoneCall->unsetData("call-model");
}
// -----------------------------------------------------------------------------
void CallModel::setRecordFile (shared_ptr<linphone::CallParams> &callParams) {

View file

@ -65,7 +65,7 @@ public:
Q_ENUM(CallStatus);
CallModel (std::shared_ptr<linphone::Call> linphoneCall);
~CallModel () = default;
~CallModel ();
std::shared_ptr<linphone::Call> getLinphoneCall () const {
return mLinphoneCall;

View file

@ -179,7 +179,6 @@ void CallsListModel::addCall (const shared_ptr<linphone::Call> &linphoneCall) {
qInfo() << "Add call:" << call;
App::getInstance()->getEngine()->setObjectOwnership(call, QQmlEngine::CppOwnership);
linphoneCall->setData("call-model", *call);
int row = mList.count();
@ -193,7 +192,6 @@ void CallsListModel::removeCall (const shared_ptr<linphone::Call> &linphoneCall)
QTimer::singleShot(
DELAY_BEFORE_REMOVE_CALL, this, [this, linphoneCall]() {
CallModel *call = &linphoneCall->getData<CallModel>("call-model");
linphoneCall->unsetData("call-model");
qInfo() << "Removing call:" << call;