aboutsummaryrefslogtreecommitdiff
path: root/launcher/LaunchController.cpp
diff options
context:
space:
mode:
authorflow <flowlnlnln@gmail.com>2023-01-13 17:21:12 -0300
committerGitHub <noreply@github.com>2023-01-13 17:21:12 -0300
commit3de681d2d64339fe8f46043278c21748907f33ad (patch)
treefb1559392065b0972e6f3fa32e188ebf3fd55f28 /launcher/LaunchController.cpp
parentb937d334362c0810ab59b3bc4660a2bbea31c7da (diff)
parent4e80d1fc79fcd2181dcf5975553f39a6895f4635 (diff)
downloadPrismLauncher-3de681d2d64339fe8f46043278c21748907f33ad.tar.gz
PrismLauncher-3de681d2d64339fe8f46043278c21748907f33ad.tar.bz2
PrismLauncher-3de681d2d64339fe8f46043278c21748907f33ad.zip
Merge pull request #685 from byteduck/instance-accounts
Diffstat (limited to 'launcher/LaunchController.cpp')
-rw-r--r--launcher/LaunchController.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/launcher/LaunchController.cpp b/launcher/LaunchController.cpp
index 11e3de15..9741fd95 100644
--- a/launcher/LaunchController.cpp
+++ b/launcher/LaunchController.cpp
@@ -112,7 +112,15 @@ 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.