Commit 12c404bd authored by Andreas Traczyk's avatar Andreas Traczyk

fix: catch exception on invalid account creation

Change-Id: Iafffd0d256e261f80252a14732afee8c3508f28c
parent 6815714a
......@@ -1232,20 +1232,26 @@ CallWidget::updateConversationForNewContact(const std::string& convUid)
void
CallWidget::updateSmartList()
{
if (!ui->smartList->model()) {
smartListModel_.reset(new SmartListModel(LRCInstance::getCurrAccId(), this));
ui->smartList->setModel(smartListModel_.get());
ui->smartList->setItemDelegate(new ConversationItemDelegate());
} else {
smartListModel_->setAccount(LRCInstance::getCurrAccId());
}
// smartlist selection
QObject::disconnect(smartlistSelectionConnection_);
smartlistSelectionConnection_ = connect(ui->smartList->selectionModel(),
SIGNAL(selectionChanged(QItemSelection, QItemSelection)),
this,
SLOT(smartListSelectionChanged(QItemSelection, QItemSelection)));
try {
if (!ui->smartList->model()) {
smartListModel_.reset(new SmartListModel(LRCInstance::getCurrAccId(), this));
ui->smartList->setModel(smartListModel_.get());
ui->smartList->setItemDelegate(new ConversationItemDelegate());
} else {
smartListModel_->setAccount(LRCInstance::getCurrAccId());
}
// smartlist selection
QObject::disconnect(smartlistSelectionConnection_);
smartlistSelectionConnection_ = connect(ui->smartList->selectionModel(),
SIGNAL(selectionChanged(QItemSelection, QItemSelection)),
this,
SLOT(smartListSelectionChanged(QItemSelection, QItemSelection)));
} catch (...) {
qWarning() << "No account selected!";
return;
}
}
void
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment