mirror of
https://gitlab.linphone.org/BC/public/linphone-desktop.git
synced 2026-01-17 03:18:07 +00:00
fix #LINQT-1839 force switching to main page when account added and remote provisioning configured
This commit is contained in:
parent
38a47b4680
commit
a1e2c253bf
1 changed files with 15 additions and 0 deletions
|
|
@ -381,6 +381,21 @@ void App::setSelf(QSharedPointer<App>(me)) {
|
|||
});
|
||||
}
|
||||
});
|
||||
mCoreModelConnection->makeConnectToModel(
|
||||
&CoreModel::accountAdded,
|
||||
[this](const std::shared_ptr<linphone::Core> &core, const std::shared_ptr<linphone::Account> &account) {
|
||||
mustBeInLinphoneThread(log().arg(Q_FUNC_INFO));
|
||||
if (CoreModel::getInstance()->mConfigStatus == linphone::ConfiguringState::Successful) {
|
||||
bool accountConnected = account && account->getState() == linphone::RegistrationState::Ok;
|
||||
mCoreModelConnection->invokeToCore([this, accountConnected]() {
|
||||
mustBeInMainThread(log().arg(Q_FUNC_INFO));
|
||||
// There is an account added by a remote provisioning, force switching to main page
|
||||
// because the account may not be connected already
|
||||
QMetaObject::invokeMethod(mMainWindow, "openMainPage", Qt::DirectConnection,
|
||||
Q_ARG(QVariant, accountConnected));
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
// Synchronize state for because linphoneCore was ran before any connections.
|
||||
mCoreModelConnection->invokeToModel([this]() {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue