mirror of
https://github.com/UltimMC/Launcher.git
synced 2025-12-25 04:44:59 +00:00
Fix conflict
This commit is contained in:
@@ -2,13 +2,40 @@
|
||||
|
||||
#include <sys/utsname.h>
|
||||
|
||||
#include <QString>
|
||||
#include <QStringList>
|
||||
#include <QDebug>
|
||||
|
||||
Sys::KernelInfo Sys::getKernelInfo()
|
||||
{
|
||||
Sys::KernelInfo out;
|
||||
struct utsname buf;
|
||||
uname(&buf);
|
||||
out.kernelType = KernelType::Darwin;
|
||||
out.kernelName = buf.sysname;
|
||||
out.kernelVersion = buf.release;
|
||||
QString release = out.kernelVersion = buf.release;
|
||||
|
||||
// TODO: figure out how to detect cursed-ness (macOS emulated on linux via mad hacks and so on)
|
||||
out.isCursed = false;
|
||||
|
||||
out.kernelMajor = 0;
|
||||
out.kernelMinor = 0;
|
||||
out.kernelPatch = 0;
|
||||
auto sections = release.split('-');
|
||||
if(sections.size() >= 1) {
|
||||
auto versionParts = sections[0].split('.');
|
||||
if(versionParts.size() >= 3) {
|
||||
out.kernelMajor = versionParts[0].toInt();
|
||||
out.kernelMinor = versionParts[1].toInt();
|
||||
out.kernelPatch = versionParts[2].toInt();
|
||||
}
|
||||
else {
|
||||
qWarning() << "Not enough version numbers in " << sections[0] << " found " << versionParts.size();
|
||||
}
|
||||
}
|
||||
else {
|
||||
qWarning() << "Not enough '-' sections in " << release << " found " << sections.size();
|
||||
}
|
||||
return out;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user