Skip to content
Snippets Groups Projects
Commit 70c520e8 authored by Ming Rui Zhang's avatar Ming Rui Zhang
Browse files

pendingConferenceesListModel: avoid invalid connections

Change-Id: I9d073cb5203a887fd5e39ced258b19e0196d069b
parent 7084f6dd
No related branches found
No related tags found
No related merge requests found
...@@ -125,17 +125,18 @@ PendingConferenceesListModel::connectSignals() ...@@ -125,17 +125,18 @@ PendingConferenceesListModel::connectSignals()
disconnect(beginRemovePendingConferencesRows_); disconnect(beginRemovePendingConferencesRows_);
disconnect(endRemovePendingConferencesRows_); disconnect(endRemovePendingConferencesRows_);
auto currentCallModel = lrcInstance_->getCurrentCallModel();
if (!currentCallModel)
return;
using namespace PendingConferences; using namespace PendingConferences;
callsStatusChanged_ = connect(lrcInstance_->getCurrentCallModel(), callsStatusChanged_
&NewCallModel::callStatusChanged, = connect(currentCallModel, &NewCallModel::callStatusChanged, [this](const QString&, int) {
[this](const QString&, int) { Q_EMIT dataChanged(index(0, 0), index(rowCount() - 1), {Role::CallStatus});
Q_EMIT dataChanged(index(0, 0), });
index(rowCount() - 1),
{Role::CallStatus});
});
beginInsertPendingConferencesRows_ = connect( beginInsertPendingConferencesRows_ = connect(
lrcInstance_->getCurrentCallModel(), currentCallModel,
&NewCallModel::beginInsertPendingConferenceesRows, &NewCallModel::beginInsertPendingConferenceesRows,
this, this,
[this](int position, int rows) { [this](int position, int rows) {
...@@ -144,14 +145,14 @@ PendingConferenceesListModel::connectSignals() ...@@ -144,14 +145,14 @@ PendingConferenceesListModel::connectSignals()
Qt::DirectConnection); Qt::DirectConnection);
endInsertPendingConferencesRows_ = connect( endInsertPendingConferencesRows_ = connect(
lrcInstance_->getCurrentCallModel(), currentCallModel,
&NewCallModel::endInsertPendingConferenceesRows, &NewCallModel::endInsertPendingConferenceesRows,
this, this,
[this]() { endInsertRows(); }, [this]() { endInsertRows(); },
Qt::DirectConnection); Qt::DirectConnection);
beginRemovePendingConferencesRows_ = connect( beginRemovePendingConferencesRows_ = connect(
lrcInstance_->getCurrentCallModel(), currentCallModel,
&NewCallModel::beginRemovePendingConferenceesRows, &NewCallModel::beginRemovePendingConferenceesRows,
this, this,
[this](int position, int rows) { [this](int position, int rows) {
...@@ -160,7 +161,7 @@ PendingConferenceesListModel::connectSignals() ...@@ -160,7 +161,7 @@ PendingConferenceesListModel::connectSignals()
Qt::DirectConnection); Qt::DirectConnection);
endRemovePendingConferencesRows_ = connect( endRemovePendingConferencesRows_ = connect(
lrcInstance_->getCurrentCallModel(), currentCallModel,
&NewCallModel::endRemovePendingConferenceesRows, &NewCallModel::endRemovePendingConferenceesRows,
this, this,
[this]() { endRemoveRows(); }, [this]() { endRemoveRows(); },
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment