GH-4014 change updater to recognize new Qt 5.15.2 builds

This commit is contained in:
Petr Mrázek
2021-09-04 21:27:09 +02:00
parent cd87029e6f
commit 938f896bfa
13 changed files with 141 additions and 26 deletions

View File

@@ -2,13 +2,33 @@
#include <sys/utsname.h>
#include <QString>
#include <QStringList>
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(sections.size() >= 3) {
out.kernelMajor = sections[0].toInt();
out.kernelMinor = sections[1].toInt();
out.kernelPatch = sections[2].toInt();
}
}
return out;
}