QSysInfo::prettyProductName(): add missing macOS product names

Change-Id: I9163917187b7a4cbf48e443303313b25473b229f
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit 870cfa4e17c42698b77504cfc19728acfbf7d659)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
Yuhang Zhao 2022-05-24 14:05:10 +08:00 committed by Qt Cherry-pick Bot
parent c711bf3158
commit 0cead45f8c

View File

@ -2091,6 +2091,11 @@ QT_END_INCLUDE_NAMESPACE
static const char *osVer_helper(QOperatingSystemVersion version = QOperatingSystemVersion::current())
{
#ifdef Q_OS_MACOS
if (version.majorVersion() == 12)
return "Monterey";
// Compare against predefined constant to handle 10.16/11.0
if (QOperatingSystemVersion::MacOSBigSur.version().isPrefixOf(version.version()))
return "Big Sur";
if (version.majorVersion() == 10) {
switch (version.minorVersion()) {
case 9:
@ -2105,13 +2110,15 @@ static const char *osVer_helper(QOperatingSystemVersion version = QOperatingSyst
return "High Sierra";
case 14:
return "Mojave";
case 15:
return "Catalina";
}
}
// unknown, future version
#else
Q_UNUSED(version);
#endif
return 0;
return nullptr;
}
#endif
@ -2205,7 +2212,7 @@ static const char *osVer_helper(QOperatingSystemVersion version = QOperatingSyst
}
#undef Q_WINVER
// unknown, future version
return 0;
return nullptr;
}
#endif