Allow selecting a default account to use with an instance
Signed-off-by: Aaron <10217842+byteduck@users.noreply.github.com>
This commit is contained in:
@ -112,7 +112,19 @@ void LaunchController::decideAccount()
|
||||
}
|
||||
}
|
||||
|
||||
m_accountToUse = accounts->defaultAccount();
|
||||
// Select the account to use. If the instance has a specific account set, that will be used. Otherwise, the default account will be used
|
||||
auto instanceAccountId = m_instance->settings()->get("InstanceAccountId").toString();
|
||||
auto instanceAccountIndex = accounts->findAccountByProfileId(instanceAccountId);
|
||||
if (instanceAccountIndex == -1)
|
||||
{
|
||||
m_accountToUse = accounts->defaultAccount();
|
||||
}
|
||||
else
|
||||
{
|
||||
m_accountToUse = accounts->at(instanceAccountIndex);
|
||||
}
|
||||
|
||||
|
||||
if (!m_accountToUse)
|
||||
{
|
||||
// If no default account is set, ask the user which one to use.
|
||||
|
Reference in New Issue
Block a user