Skip to content
Snippets Groups Projects
Commit a3b984f0 authored by Andreas Traczyk's avatar Andreas Traczyk
Browse files

fix crash on app start

Change-Id: I1e2c14fe4b7ae0f133fe6a23a12ae301ab6b5408
parent 0b7bd311
Branches
Tags
No related merge requests found
...@@ -46,8 +46,28 @@ VideoOverlay::VideoOverlay(QWidget* parent) : ...@@ -46,8 +46,28 @@ VideoOverlay::VideoOverlay(QWidget* parent) :
ui->onHoldLabel->setVisible(false); ui->onHoldLabel->setVisible(false);
auto accountList = LRCInstance::accountModel().getAccountList();
if (!accountList.size()) {
QMetaObject::Connection* const connection = new QMetaObject::Connection;
connect(&LRCInstance::accountModel(),
&lrc::api::NewAccountModel::accountAdded,
[this, connection](const std::string& accountId) {
Q_UNUSED(accountId);
connect(LRCInstance::getCurrentCallModel(), &lrc::api::NewCallModel::callStarted, connect(LRCInstance::getCurrentCallModel(), &lrc::api::NewCallModel::callStarted,
[this](const std::string& tempCallId) { callId = tempCallId; }); [this](const std::string& tempCallId) {
callId = tempCallId;
});
QObject::disconnect(*connection);
if (connection) {
delete connection;
}
});
} else {
connect(LRCInstance::getCurrentCallModel(), &lrc::api::NewCallModel::callStarted,
[this](const std::string& tempCallId) {
callId = tempCallId;
});
}
connect(oneSecondTimer_, &QTimer::timeout, this, &VideoOverlay::setTime); connect(oneSecondTimer_, &QTimer::timeout, this, &VideoOverlay::setTime);
oneSecondTimer_->start(1000); oneSecondTimer_->start(1000);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment