chore: drop windows-specific code

This commit is contained in:
dela
2026-06-10 16:33:50 +08:00
parent 012d165b81
commit 4c783ab9ea
20 changed files with 24 additions and 588 deletions

View File

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