chore: drop windows-specific code
This commit is contained in:
@@ -65,29 +65,10 @@ QString compactProductType(QString type)
|
||||
return type;
|
||||
}
|
||||
|
||||
int windowsBuildNumber()
|
||||
{
|
||||
const QStringList parts = QSysInfo::kernelVersion().split(QLatin1Char('.'));
|
||||
bool ok = false;
|
||||
const int build = parts.size() >= 3 ? parts.at(2).toInt(&ok) : 0;
|
||||
return ok ? build : 0;
|
||||
}
|
||||
|
||||
|
||||
QString readableOsName()
|
||||
{
|
||||
const QString type = QSysInfo::productType().toLower();
|
||||
const QString version = QSysInfo::productVersion().trimmed();
|
||||
if (type == QStringLiteral("windows"))
|
||||
{
|
||||
const int build = windowsBuildNumber();
|
||||
if (build >= 22000)
|
||||
return QStringLiteral("Win11");
|
||||
if (build > 0)
|
||||
return QStringLiteral("Win10");
|
||||
return version.isEmpty() ? QStringLiteral("Windows")
|
||||
: QStringLiteral("Windows%1").arg(version);
|
||||
}
|
||||
if (type == QStringLiteral("macos") || type == QStringLiteral("osx"))
|
||||
return version.isEmpty() ? QStringLiteral("macOS")
|
||||
: QStringLiteral("macOS%1").arg(version);
|
||||
|
||||
Reference in New Issue
Block a user