mirror of
https://github.com/redstrate/Astra.git
synced 2025-04-20 19:57:45 +00:00
Save the last profile selected in the launcher in the config
This commit is contained in:
parent
67dcd90058
commit
24f256338d
2 changed files with 9 additions and 0 deletions
|
@ -22,6 +22,8 @@ SPDX-License-Identifier: CC0-1.0
|
|||
</entry>
|
||||
<entry name="AutoLoginProfile" type="String">
|
||||
</entry>
|
||||
<entry name="CurrentProfile" type="String">
|
||||
</entry>
|
||||
</group>
|
||||
<group name="Developer">
|
||||
<entry name="KeepPatches" type="bool">
|
||||
|
|
|
@ -399,6 +399,11 @@ void LauncherCore::readInitialInformation()
|
|||
}
|
||||
}
|
||||
|
||||
// set default profile, if found
|
||||
if (auto profile = m_profileManager->getProfileByUUID(m_config->currentProfile()); profile != nullptr) {
|
||||
setCurrentProfile(profile);
|
||||
}
|
||||
|
||||
m_loadingFinished = true;
|
||||
Q_EMIT loadingFinished();
|
||||
}
|
||||
|
@ -797,6 +802,8 @@ void LauncherCore::setCurrentProfile(Profile *profile)
|
|||
const int newIndex = m_profileManager->getProfileIndex(profile->uuid());
|
||||
if (newIndex != m_currentProfileIndex) {
|
||||
m_currentProfileIndex = newIndex;
|
||||
m_config->setCurrentProfile(profile->uuid());
|
||||
m_config->save();
|
||||
Q_EMIT currentProfileChanged();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue