From 4033a928917280a60baeafc4d91c2b7f115ceb5d Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Mon, 22 May 2017 11:19:17 +0200 Subject: [PATCH] feat(src/components/calls/CallsListModel): remove `getCallModel` function --- linphone-desktop/src/components/calls/CallsListModel.cpp | 5 ----- linphone-desktop/src/components/calls/CallsListModel.hpp | 2 -- linphone-desktop/src/components/notifier/Notifier.cpp | 2 +- 3 files changed, 1 insertion(+), 8 deletions(-) diff --git a/linphone-desktop/src/components/calls/CallsListModel.cpp b/linphone-desktop/src/components/calls/CallsListModel.cpp index 90435feb1..84b009016 100644 --- a/linphone-desktop/src/components/calls/CallsListModel.cpp +++ b/linphone-desktop/src/components/calls/CallsListModel.cpp @@ -80,11 +80,6 @@ QVariant CallsListModel::data (const QModelIndex &index, int role) const { return QVariant(); } -CallModel *CallsListModel::getCallModel (const shared_ptr &call) const { - auto it = findCallModel(*(const_cast *>(&mList)), call); - return it != mList.end() ? *it : nullptr; -} - // ----------------------------------------------------------------------------- void CallsListModel::launchAudioCall (const QString &sipUri) const { diff --git a/linphone-desktop/src/components/calls/CallsListModel.hpp b/linphone-desktop/src/components/calls/CallsListModel.hpp index 7df045579..3e390bfb7 100644 --- a/linphone-desktop/src/components/calls/CallsListModel.hpp +++ b/linphone-desktop/src/components/calls/CallsListModel.hpp @@ -43,8 +43,6 @@ public: QHash roleNames () const override; QVariant data (const QModelIndex &index, int role = Qt::DisplayRole) const override; - CallModel *getCallModel (const std::shared_ptr &call) const; - Q_INVOKABLE void launchAudioCall (const QString &sipUri) const; Q_INVOKABLE void launchVideoCall (const QString &sipUri) const; diff --git a/linphone-desktop/src/components/notifier/Notifier.cpp b/linphone-desktop/src/components/notifier/Notifier.cpp index 1a8e2d878..8e0a5d6b5 100644 --- a/linphone-desktop/src/components/notifier/Notifier.cpp +++ b/linphone-desktop/src/components/notifier/Notifier.cpp @@ -256,7 +256,7 @@ void Notifier::notifyReceivedCall (const shared_ptr &call) { if (!notification) return; - CallModel *callModel = CoreManager::getInstance()->getCallsListModel()->getCallModel(call); + CallModel *callModel = &call->getData("call-model"); QObject::connect( callModel, &CallModel::statusChanged, notification, [this, notification](CallModel::CallStatus status) {