refactor: drop 64-bit check

Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
This commit is contained in:
Sefa Eyeoglu 2022-08-08 19:18:36 +02:00
parent 7bd8bd13fe
commit 7e280de361
No known key found for this signature in database
GPG Key ID: C10411294912A422
5 changed files with 0 additions and 69 deletions

View File

@ -121,7 +121,6 @@ void CheckJava::checkJavaFinished(JavaCheckResult result)
emit logLine(QString("Could not start java:"), MessageLevel::Error);
emit logLines(result.errorLog.split('\n'), MessageLevel::Error);
emit logLine(QString("\nCheck your Java settings."), MessageLevel::Launcher);
printSystemInfo(false, false);
emitFailed(QString("Could not start java!"));
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 logLines(result.outLog.split('\n'), MessageLevel::Warning);
emit logLine("\nMinecraft might not start properly.", MessageLevel::Launcher);
printSystemInfo(false, false);
emitSucceeded();
return;
}
@ -138,7 +136,6 @@ void CheckJava::checkJavaFinished(JavaCheckResult result)
{
auto instance = m_parent->instance();
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("JavaArchitecture", result.mojangPlatform);
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")
.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);
}
}
}

View File

@ -56,8 +56,4 @@ struct DistributionInfo
DistributionInfo getDistributionInfo();
uint64_t getSystemRam();
bool isSystem64bit();
bool isCPU64bit();
}

View File

@ -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()
{
DistributionInfo result;

View File

@ -82,17 +82,6 @@ uint64_t Sys::getSystemRam()
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()
{
DistributionInfo systemd_info = read_os_release();

View File

@ -27,28 +27,6 @@ uint64_t Sys::getSystemRam()
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()
{
DistributionInfo result;