GH-992 Add a transaction/locking mechanism to settings objects

This can cut the FTB loading by ~66% - worth it, but not ideal.
Real solution will have to be implemented later.
This commit is contained in:
Petr Mrázek
2015-05-23 16:07:47 +02:00
parent 0e0ddf5494
commit ce99fabe13
14 changed files with 102 additions and 41 deletions

View File

@ -170,12 +170,12 @@ BaseProcess *OneSixInstance::prepareForLaunch(AuthSessionPtr session)
// window size, title and state, legacy
{
QString windowParams;
if (settings().get("LaunchMaximized").toBool())
if (settings()->get("LaunchMaximized").toBool())
windowParams = "max";
else
windowParams = QString("%1x%2")
.arg(settings().get("MinecraftWinWidth").toInt())
.arg(settings().get("MinecraftWinHeight").toInt());
.arg(settings()->get("MinecraftWinWidth").toInt())
.arg(settings()->get("MinecraftWinHeight").toInt());
launchScript += "windowTitle " + windowTitle() + "\n";
launchScript += "windowParams " + windowParams + "\n";
}
@ -260,7 +260,7 @@ std::shared_ptr<ModList> OneSixInstance::texturePackList() const
bool OneSixInstance::setIntendedVersionId(QString version)
{
settings().set("IntendedVersion", version);
settings()->set("IntendedVersion", version);
if(getMinecraftProfile())
{
clearProfile();
@ -283,7 +283,7 @@ QList< Mod > OneSixInstance::getJarMods() const
QString OneSixInstance::intendedVersionId() const
{
return settings().get("IntendedVersion").toString();
return settings()->get("IntendedVersion").toString();
}
void OneSixInstance::setShouldUpdate(bool)