diff options
author | TheKodeToad <TheKodeToad@proton.me> | 2023-08-16 20:46:16 +0100 |
---|---|---|
committer | TheKodeToad <TheKodeToad@proton.me> | 2023-08-16 22:23:38 +0100 |
commit | 3e2733d840d24ce4f46b49bca0b8656d4d6e3d87 (patch) | |
tree | 386113207514b8071b0122b318c10439259ca83c /launcher/minecraft/launch/VerifyJavaInstall.cpp | |
parent | 57430fd189aed592a170d597de61b3acabaaa43d (diff) | |
parent | c88088c91a92a371a9bc2b7384c2897157772b7e (diff) | |
download | PrismLauncher-3e2733d840d24ce4f46b49bca0b8656d4d6e3d87.tar.gz PrismLauncher-3e2733d840d24ce4f46b49bca0b8656d4d6e3d87.tar.bz2 PrismLauncher-3e2733d840d24ce4f46b49bca0b8656d4d6e3d87.zip |
Merge branch 'develop' into better-launch
Signed-off-by: TheKodeToad <TheKodeToad@proton.me>
Diffstat (limited to 'launcher/minecraft/launch/VerifyJavaInstall.cpp')
-rw-r--r-- | launcher/minecraft/launch/VerifyJavaInstall.cpp | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/launcher/minecraft/launch/VerifyJavaInstall.cpp b/launcher/minecraft/launch/VerifyJavaInstall.cpp index 6ae666b4..cdd1f7fd 100644 --- a/launcher/minecraft/launch/VerifyJavaInstall.cpp +++ b/launcher/minecraft/launch/VerifyJavaInstall.cpp @@ -1,6 +1,6 @@ // SPDX-License-Identifier: GPL-3.0-only /* - * PolyMC - Minecraft Launcher + * Prism Launcher - Minecraft Launcher * Copyright (C) 2022 Sefa Eyeoglu <contact@scrumplex.net> * * This program is free software: you can redistribute it and/or modify @@ -36,10 +36,11 @@ #include "VerifyJavaInstall.h" #include "java/JavaVersion.h" -#include "minecraft/PackProfile.h" #include "minecraft/MinecraftInstance.h" +#include "minecraft/PackProfile.h" -void VerifyJavaInstall::executeTask() { +void VerifyJavaInstall::executeTask() +{ auto instance = std::dynamic_pointer_cast<MinecraftInstance>(m_parent->instance()); auto packProfile = instance->getPackProfile(); auto settings = instance->settings(); @@ -50,28 +51,27 @@ void VerifyJavaInstall::executeTask() { JavaVersion javaVersion(storedVersion); - if (compatibleMajors.isEmpty() || compatibleMajors.contains(javaVersion.major())) - { + if (compatibleMajors.isEmpty() || compatibleMajors.contains(javaVersion.major())) { emitSucceeded(); return; } - - if (ignoreCompatibility) - { + if (ignoreCompatibility) { emit logLine(tr("Java major version is incompatible. Things might break."), MessageLevel::Warning); emitSucceeded(); return; } emit logLine(tr("This instance is not compatible with Java version %1.\n" - "Please switch to one of the following Java versions for this instance:").arg(javaVersion.major()), + "Please switch to one of the following Java versions for this instance:") + .arg(javaVersion.major()), MessageLevel::Error); - for (auto major : compatibleMajors) - { + for (auto major : compatibleMajors) { emit logLine(tr("Java version %1").arg(major), MessageLevel::Error); } - emit logLine(tr("Go to instance Java settings to change your Java version or disable the Java compatibility check if you know what you're doing."), MessageLevel::Error); + emit logLine(tr("Go to instance Java settings to change your Java version or disable the Java compatibility check if you know what " + "you're doing."), + MessageLevel::Error); emitFailed(QString("Incompatible Java major version")); } |