Set a default account when removing the default account

This commit is contained in:
Christophe Deschamps 2024-09-04 11:16:13 +02:00
parent 680d398c36
commit 7da33786d1

View file

@ -225,6 +225,8 @@ void CoreModel::onAccountAdded(const std::shared_ptr<linphone::Core> &core,
}
void CoreModel::onAccountRemoved(const std::shared_ptr<linphone::Core> &core,
const std::shared_ptr<linphone::Account> &account) {
if (core->getDefaultAccount() == nullptr && core->getAccountList().size() > 0)
core->setDefaultAccount(core->getAccountList().front());
emit accountRemoved(core, account);
}
void CoreModel::onAccountRegistrationStateChanged(const std::shared_ptr<linphone::Core> &core,