Fix conflict

This commit is contained in:
Sebastian-byte
2021-09-12 20:23:30 -05:00
parent fae9ddd925
commit 46df45ffcf
103 changed files with 5779 additions and 3800 deletions

View File

@@ -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;
}