diff options
author | Forkk <forkk@forkk.net> | 2014-01-07 18:31:49 -0600 |
---|---|---|
committer | Forkk <forkk@forkk.net> | 2014-01-07 18:31:49 -0600 |
commit | 3629f9b9995e375dad181268f5a70dc6cb7697a2 (patch) | |
tree | df2a719ebb12f129165c487ab730a6328c9750e7 /logic | |
parent | a14eeab2d6f6437f0cbd7402537ef6634085f7ac (diff) | |
parent | fb83299e592ef7627d5914e0fbce70c570981124 (diff) | |
download | MultiMC-3629f9b9995e375dad181268f5a70dc6cb7697a2.tar MultiMC-3629f9b9995e375dad181268f5a70dc6cb7697a2.tar.gz MultiMC-3629f9b9995e375dad181268f5a70dc6cb7697a2.tar.lz MultiMC-3629f9b9995e375dad181268f5a70dc6cb7697a2.tar.xz MultiMC-3629f9b9995e375dad181268f5a70dc6cb7697a2.zip |
Merge branch 'develop' of github.com:MultiMC/MultiMC5 into new-version-system
Diffstat (limited to 'logic')
-rw-r--r-- | logic/JavaChecker.cpp | 16 | ||||
-rw-r--r-- | logic/JavaChecker.h | 2 | ||||
-rw-r--r-- | logic/LegacyInstance.cpp | 6 |
3 files changed, 6 insertions, 18 deletions
diff --git a/logic/JavaChecker.cpp b/logic/JavaChecker.cpp index a470bfa2..6ee7b4cf 100644 --- a/logic/JavaChecker.cpp +++ b/logic/JavaChecker.cpp @@ -1,26 +1,20 @@ #include "JavaChecker.h" +#include "MultiMC.h" +#include <pathutils.h> #include <QFile> #include <QProcess> #include <QMap> #include <QTemporaryFile> -#define CHECKER_FILE "JavaChecker.jar" - JavaChecker::JavaChecker(QObject *parent) : QObject(parent) { } void JavaChecker::performCheck() { - checkerJar.setFileTemplate("checker_XXXXXX.jar"); - checkerJar.open(); - QFile inner(":/java/checker.jar"); - inner.open(QIODevice::ReadOnly); - checkerJar.write(inner.readAll()); - inner.close(); - checkerJar.close(); + QString checkerJar = PathCombine(MMC->bin(), "jars", "JavaCheck.jar"); - QStringList args = {"-jar", checkerJar.fileName()}; + QStringList args = {"-jar", checkerJar}; process.reset(new QProcess()); process->setArguments(args); @@ -42,7 +36,6 @@ void JavaChecker::finished(int exitcode, QProcess::ExitStatus status) killTimer.stop(); QProcessPtr _process; _process.swap(process); - checkerJar.remove(); JavaCheckResult result; { @@ -100,7 +93,6 @@ void JavaChecker::error(QProcess::ProcessError err) if(err == QProcess::FailedToStart) { killTimer.stop(); - checkerJar.remove(); JavaCheckResult result; { diff --git a/logic/JavaChecker.h b/logic/JavaChecker.h index 4705381c..e19895f7 100644 --- a/logic/JavaChecker.h +++ b/logic/JavaChecker.h @@ -1,7 +1,6 @@ #pragma once #include <QProcess> #include <QTimer> -#include <QTemporaryFile> #include <memory> class JavaChecker; @@ -35,7 +34,6 @@ signals: private: QProcessPtr process; QTimer killTimer; - QTemporaryFile checkerJar; public slots: void timeout(); diff --git a/logic/LegacyInstance.cpp b/logic/LegacyInstance.cpp index 0bc0961e..5ab19fc9 100644 --- a/logic/LegacyInstance.cpp +++ b/logic/LegacyInstance.cpp @@ -31,8 +31,6 @@ #include "gui/dialogs/LegacyModEditDialog.h" -#define LAUNCHER_FILE "MultiMCLauncher.jar" - LegacyInstance::LegacyInstance(const QString &rootDir, SettingsObject *settings, QObject *parent) : BaseInstance(new LegacyInstancePrivate(), rootDir, settings, parent) @@ -61,7 +59,7 @@ MinecraftProcess *LegacyInstance::prepareForLaunch(MojangAccountPtr account) pixmap.save(PathCombine(minecraftRoot(), "icon.png"), "PNG"); // extract the legacy launcher - QFile(":/java/launcher.jar").copy(PathCombine(minecraftRoot(), LAUNCHER_FILE)); + QString launcherJar = PathCombine(MMC->bin(), "jars", "MultiMCLauncher.jar"); // set the process arguments { @@ -104,7 +102,7 @@ MinecraftProcess *LegacyInstance::prepareForLaunch(MojangAccountPtr account) "minecraft.exe.heapdump"); #endif - args << "-jar" << LAUNCHER_FILE; + args << "-jar" << launcherJar; args << account->currentProfile()->name; args << account->sessionId(); args << windowTitle; |