refactor: drop 64-bit check
Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
This commit is contained in:
parent
7bd8bd13fe
commit
7e280de361
@ -121,7 +121,6 @@ void CheckJava::checkJavaFinished(JavaCheckResult result)
|
|||||||
emit logLine(QString("Could not start java:"), MessageLevel::Error);
|
emit logLine(QString("Could not start java:"), MessageLevel::Error);
|
||||||
emit logLines(result.errorLog.split('\n'), MessageLevel::Error);
|
emit logLines(result.errorLog.split('\n'), MessageLevel::Error);
|
||||||
emit logLine(QString("\nCheck your Java settings."), MessageLevel::Launcher);
|
emit logLine(QString("\nCheck your Java settings."), MessageLevel::Launcher);
|
||||||
printSystemInfo(false, false);
|
|
||||||
emitFailed(QString("Could not start java!"));
|
emitFailed(QString("Could not start java!"));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -130,7 +129,6 @@ void CheckJava::checkJavaFinished(JavaCheckResult result)
|
|||||||
emit logLine(QString("Java checker returned some invalid data we don't understand:"), MessageLevel::Error);
|
emit logLine(QString("Java checker returned some invalid data we don't understand:"), MessageLevel::Error);
|
||||||
emit logLines(result.outLog.split('\n'), MessageLevel::Warning);
|
emit logLines(result.outLog.split('\n'), MessageLevel::Warning);
|
||||||
emit logLine("\nMinecraft might not start properly.", MessageLevel::Launcher);
|
emit logLine("\nMinecraft might not start properly.", MessageLevel::Launcher);
|
||||||
printSystemInfo(false, false);
|
|
||||||
emitSucceeded();
|
emitSucceeded();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -138,7 +136,6 @@ void CheckJava::checkJavaFinished(JavaCheckResult result)
|
|||||||
{
|
{
|
||||||
auto instance = m_parent->instance();
|
auto instance = m_parent->instance();
|
||||||
printJavaInfo(result.javaVersion.toString(), result.mojangPlatform, result.realPlatform, result.javaVendor);
|
printJavaInfo(result.javaVersion.toString(), result.mojangPlatform, result.realPlatform, result.javaVendor);
|
||||||
printSystemInfo(true, result.is_64bit);
|
|
||||||
instance->settings()->set("JavaVersion", result.javaVersion.toString());
|
instance->settings()->set("JavaVersion", result.javaVersion.toString());
|
||||||
instance->settings()->set("JavaArchitecture", result.mojangPlatform);
|
instance->settings()->set("JavaArchitecture", result.mojangPlatform);
|
||||||
instance->settings()->set("JavaRealArchitecture", result.realPlatform);
|
instance->settings()->set("JavaRealArchitecture", result.realPlatform);
|
||||||
@ -155,20 +152,3 @@ void CheckJava::printJavaInfo(const QString& version, const QString& architectur
|
|||||||
emit logLine(QString("Java is version %1, using %2 (%3) architecture, from %4.\n\n")
|
emit logLine(QString("Java is version %1, using %2 (%3) architecture, from %4.\n\n")
|
||||||
.arg(version, architecture, realArchitecture, vendor), MessageLevel::Launcher);
|
.arg(version, architecture, realArchitecture, vendor), MessageLevel::Launcher);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CheckJava::printSystemInfo(bool javaIsKnown, bool javaIs64bit)
|
|
||||||
{
|
|
||||||
auto cpu64 = Sys::isCPU64bit();
|
|
||||||
auto system64 = Sys::isSystem64bit();
|
|
||||||
if(cpu64 != system64)
|
|
||||||
{
|
|
||||||
emit logLine(QString("Your CPU architecture is not matching your system architecture. You might want to install a 64bit Operating System.\n\n"), MessageLevel::Error);
|
|
||||||
}
|
|
||||||
if(javaIsKnown)
|
|
||||||
{
|
|
||||||
if(javaIs64bit != system64)
|
|
||||||
{
|
|
||||||
emit logLine(QString("Your Java architecture is not matching your system architecture. You might want to install a 64bit Java version.\n\n"), MessageLevel::Error);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
@ -56,8 +56,4 @@ struct DistributionInfo
|
|||||||
DistributionInfo getDistributionInfo();
|
DistributionInfo getDistributionInfo();
|
||||||
|
|
||||||
uint64_t getSystemRam();
|
uint64_t getSystemRam();
|
||||||
|
|
||||||
bool isSystem64bit();
|
|
||||||
|
|
||||||
bool isCPU64bit();
|
|
||||||
}
|
}
|
||||||
|
@ -55,18 +55,6 @@ uint64_t Sys::getSystemRam()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Sys::isCPU64bit()
|
|
||||||
{
|
|
||||||
// not even going to pretend I'm going to support anything else
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool Sys::isSystem64bit()
|
|
||||||
{
|
|
||||||
// yep. maybe when we have 128bit CPUs on consumer devices.
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
Sys::DistributionInfo Sys::getDistributionInfo()
|
Sys::DistributionInfo Sys::getDistributionInfo()
|
||||||
{
|
{
|
||||||
DistributionInfo result;
|
DistributionInfo result;
|
||||||
|
@ -82,17 +82,6 @@ uint64_t Sys::getSystemRam()
|
|||||||
return 0; // nothing found
|
return 0; // nothing found
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Sys::isCPU64bit()
|
|
||||||
{
|
|
||||||
return isSystem64bit();
|
|
||||||
}
|
|
||||||
|
|
||||||
bool Sys::isSystem64bit()
|
|
||||||
{
|
|
||||||
// kernel build arch on linux
|
|
||||||
return QSysInfo::currentCpuArchitecture() == "x86_64";
|
|
||||||
}
|
|
||||||
|
|
||||||
Sys::DistributionInfo Sys::getDistributionInfo()
|
Sys::DistributionInfo Sys::getDistributionInfo()
|
||||||
{
|
{
|
||||||
DistributionInfo systemd_info = read_os_release();
|
DistributionInfo systemd_info = read_os_release();
|
||||||
|
@ -27,28 +27,6 @@ uint64_t Sys::getSystemRam()
|
|||||||
return (uint64_t)status.ullTotalPhys;
|
return (uint64_t)status.ullTotalPhys;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Sys::isSystem64bit()
|
|
||||||
{
|
|
||||||
#if defined(_WIN64)
|
|
||||||
return true;
|
|
||||||
#elif defined(_WIN32)
|
|
||||||
BOOL f64 = false;
|
|
||||||
return IsWow64Process(GetCurrentProcess(), &f64) && f64;
|
|
||||||
#else
|
|
||||||
// it's some other kind of system...
|
|
||||||
return false;
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
bool Sys::isCPU64bit()
|
|
||||||
{
|
|
||||||
SYSTEM_INFO info;
|
|
||||||
ZeroMemory(&info, sizeof(SYSTEM_INFO));
|
|
||||||
GetNativeSystemInfo(&info);
|
|
||||||
auto arch = info.wProcessorArchitecture;
|
|
||||||
return arch == PROCESSOR_ARCHITECTURE_AMD64 || arch == PROCESSOR_ARCHITECTURE_IA64;
|
|
||||||
}
|
|
||||||
|
|
||||||
Sys::DistributionInfo Sys::getDistributionInfo()
|
Sys::DistributionInfo Sys::getDistributionInfo()
|
||||||
{
|
{
|
||||||
DistributionInfo result;
|
DistributionInfo result;
|
||||||
|
Loading…
Reference in New Issue
Block a user