Update account list when core is in state GlobalOn

This commit is contained in:
Christophe Deschamps 2025-01-28 14:47:53 +01:00
parent 8003b09e3b
commit fdbe13928a

View file

@ -84,14 +84,15 @@ void AccountList::setSelf(QSharedPointer<AccountList> me) {
});
mModelConnection->makeConnectToModel(&CoreModel::accountRemoved, [this] { emit lUpdate(); });
mModelConnection->makeConnectToModel(&CoreModel::accountAdded, [this] { emit lUpdate(); });
QObject::connect(CoreModel::getInstance().get(), &CoreModel::configuringStatus, this,
[this](const std::shared_ptr<linphone::Core> &core, linphone::ConfiguringState status,
const std::string &message) {
mustBeInLinphoneThread(log().arg(Q_FUNC_INFO));
if (status == linphone::ConfiguringState::Successful) {
emit lUpdate();
}
});
mModelConnection->makeConnectToModel(
&CoreModel::globalStateChanged,
[this](const std::shared_ptr<linphone::Core> &core, linphone::GlobalState gstate, const std::string &message) {
mustBeInLinphoneThread(log().arg(Q_FUNC_INFO));
if (gstate == linphone::GlobalState::On) {
emit lUpdate();
}
});
lUpdate(true);
}