diff options
author | Petr Mrázek <peterix@gmail.com> | 2015-05-23 16:07:47 +0200 |
---|---|---|
committer | Petr Mrázek <peterix@gmail.com> | 2015-05-23 16:07:47 +0200 |
commit | ce99fabe1396ed2956dc7ecb468760ef88f98765 (patch) | |
tree | 603f7c6f1a0f27805b21843ec3f829354ad0ff77 /logic/minecraft/MinecraftProcess.cpp | |
parent | 0e0ddf5494ab4a264b0dc18c4b94809844300dc0 (diff) | |
download | MultiMC-ce99fabe1396ed2956dc7ecb468760ef88f98765.tar MultiMC-ce99fabe1396ed2956dc7ecb468760ef88f98765.tar.gz MultiMC-ce99fabe1396ed2956dc7ecb468760ef88f98765.tar.lz MultiMC-ce99fabe1396ed2956dc7ecb468760ef88f98765.tar.xz MultiMC-ce99fabe1396ed2956dc7ecb468760ef88f98765.zip |
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.
Diffstat (limited to 'logic/minecraft/MinecraftProcess.cpp')
-rw-r--r-- | logic/minecraft/MinecraftProcess.cpp | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/logic/minecraft/MinecraftProcess.cpp b/logic/minecraft/MinecraftProcess.cpp index fc2c8a39..d52eb97c 100644 --- a/logic/minecraft/MinecraftProcess.cpp +++ b/logic/minecraft/MinecraftProcess.cpp @@ -117,7 +117,7 @@ QMap<QString, QString> MinecraftProcess::getVariables() const out.insert("INST_ID", mcInstance->id()); out.insert("INST_DIR", QDir(mcInstance->instanceRoot()).absolutePath()); out.insert("INST_MC_DIR", QDir(mcInstance->minecraftRoot()).absolutePath()); - out.insert("INST_JAVA", mcInstance->settings().get("JavaPath").toString()); + out.insert("INST_JAVA", mcInstance->settings()->get("JavaPath").toString()); out.insert("INST_JAVA_ARGS", javaArguments().join(' ')); return out; } @@ -141,14 +141,14 @@ QStringList MinecraftProcess::javaArguments() const "minecraft.exe.heapdump"); #endif - args << QString("-Xms%1m").arg(m_instance->settings().get("MinMemAlloc").toInt()); - args << QString("-Xmx%1m").arg(m_instance->settings().get("MaxMemAlloc").toInt()); + args << QString("-Xms%1m").arg(m_instance->settings()->get("MinMemAlloc").toInt()); + args << QString("-Xmx%1m").arg(m_instance->settings()->get("MaxMemAlloc").toInt()); // No PermGen in newer java. - auto javaVersion = m_instance->settings().get("JavaVersion"); + auto javaVersion = m_instance->settings()->get("JavaVersion"); if(Strings::naturalCompare(javaVersion.toString(), "1.8.0", Qt::CaseInsensitive) < 0) { - auto permgen = m_instance->settings().get("PermGen").toInt(); + auto permgen = m_instance->settings()->get("PermGen").toInt(); if (permgen != 64) { args << QString("-XX:PermSize=%1m").arg(permgen); @@ -176,7 +176,7 @@ void MinecraftProcess::arm() m_instance->setLastLaunch(); - QString JavaPath = m_instance->settings().get("JavaPath").toString(); + QString JavaPath = m_instance->settings()->get("JavaPath").toString(); emit log("Java path is:\n" + JavaPath + "\n\n"); auto realJavaPath = QStandardPaths::findExecutable(JavaPath); @@ -191,7 +191,7 @@ void MinecraftProcess::arm() { QFileInfo javaInfo(realJavaPath); qlonglong javaUnixTime = javaInfo.lastModified().toMSecsSinceEpoch(); - auto storedUnixTime = m_instance->settings().get("JavaTimestamp").toLongLong(); + auto storedUnixTime = m_instance->settings()->get("JavaTimestamp").toLongLong(); // if they are not the same, check! if(javaUnixTime != storedUnixTime) { @@ -229,8 +229,8 @@ void MinecraftProcess::arm() return; } emit log(tr("Java version is %1!\n").arg(version), MessageLevel::MultiMC); - m_instance->settings().set("JavaVersion", version); - m_instance->settings().set("JavaTimestamp", javaUnixTime); + m_instance->settings()->set("JavaVersion", version); + m_instance->settings()->set("JavaTimestamp", javaUnixTime); } } |