Started workin on stuff
Signed-off-by: Trial97 <alexandru.tripon97@gmail.com>
This commit is contained in:
parent
33cf7066b4
commit
a0e7729aa6
28 changed files with 908 additions and 247 deletions
|
@ -37,6 +37,7 @@
|
|||
#include <FileSystem.h>
|
||||
#include <launch/LaunchTask.h>
|
||||
#include <sys.h>
|
||||
#include <QCryptographicHash>
|
||||
#include <QFileInfo>
|
||||
#include <QStandardPaths>
|
||||
#include "java/JavaUtils.h"
|
||||
|
@ -90,11 +91,10 @@ void CheckJava::executeTask()
|
|||
// if timestamps are not the same, or something is missing, check!
|
||||
if (m_javaSignature != storedSignature || storedVersion.size() == 0 || storedArchitecture.size() == 0 ||
|
||||
storedRealArchitecture.size() == 0 || storedVendor.size() == 0) {
|
||||
m_JavaChecker.reset(new JavaChecker);
|
||||
m_JavaChecker.reset(new JavaChecker(realJavaPath, "", 0, 0, 0, 0, this));
|
||||
emit logLine(QString("Checking Java version..."), MessageLevel::Launcher);
|
||||
connect(m_JavaChecker.get(), &JavaChecker::checkFinished, this, &CheckJava::checkJavaFinished);
|
||||
m_JavaChecker->m_path = realJavaPath;
|
||||
m_JavaChecker->performCheck();
|
||||
m_JavaChecker->start();
|
||||
return;
|
||||
} else {
|
||||
auto verString = instance->settings()->get("JavaVersion").toString();
|
||||
|
@ -106,10 +106,10 @@ void CheckJava::executeTask()
|
|||
emitSucceeded();
|
||||
}
|
||||
|
||||
void CheckJava::checkJavaFinished(JavaCheckResult result)
|
||||
void CheckJava::checkJavaFinished(JavaChecker::Result result)
|
||||
{
|
||||
switch (result.validity) {
|
||||
case JavaCheckResult::Validity::Errored: {
|
||||
case JavaChecker::Result::Validity::Errored: {
|
||||
// Error message displayed if java can't start
|
||||
emit logLine(QString("Could not start java:"), MessageLevel::Error);
|
||||
emit logLines(result.errorLog.split('\n'), MessageLevel::Error);
|
||||
|
@ -117,14 +117,14 @@ void CheckJava::checkJavaFinished(JavaCheckResult result)
|
|||
emitFailed(QString("Could not start java!"));
|
||||
return;
|
||||
}
|
||||
case JavaCheckResult::Validity::ReturnedInvalidData: {
|
||||
case JavaChecker::Result::Validity::ReturnedInvalidData: {
|
||||
emit logLine(QString("Java checker returned some invalid data we don't understand:"), MessageLevel::Error);
|
||||
emit logLines(result.outLog.split('\n'), MessageLevel::Warning);
|
||||
emit logLine("\nMinecraft might not start properly.", MessageLevel::Launcher);
|
||||
emitSucceeded();
|
||||
return;
|
||||
}
|
||||
case JavaCheckResult::Validity::Valid: {
|
||||
case JavaChecker::Result::Validity::Valid: {
|
||||
auto instance = m_parent->instance();
|
||||
printJavaInfo(result.javaVersion.toString(), result.mojangPlatform, result.realPlatform, result.javaVendor);
|
||||
instance->settings()->set("JavaVersion", result.javaVersion.toString());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue