From 0c43ef5023ab35cf937108c374b0a0c4c78a19c5 Mon Sep 17 00:00:00 2001 From: Jake Petroules Date: Fri, 10 Jun 2016 21:39:25 -0700 Subject: Update for the newest Darwin-family operating systems. This also corrects for some code that was not included in the forward merge from 5.6 (ea438b2508f329698e11c6dae6994d441c6e67df) due to code restructuring. Change-Id: I90a20fbcb60cfd6deb1cca3716a62754af27901f Reviewed-by: Thiago Macieira --- src/corelib/global/qglobal.cpp | 17 ++++++++++++++--- src/corelib/global/qsysinfo.h | 4 +++- src/corelib/global/qsystemdetection.h | 6 +++--- 3 files changed, 20 insertions(+), 7 deletions(-) (limited to 'src/corelib') diff --git a/src/corelib/global/qglobal.cpp b/src/corelib/global/qglobal.cpp index 678788c2ef..c244f7cd61 100644 --- a/src/corelib/global/qglobal.cpp +++ b/src/corelib/global/qglobal.cpp @@ -1232,6 +1232,12 @@ bool qSharedBuild() Q_DECL_NOTHROW \value MV_IOS_9_3 iOS 9.3 \value MV_IOS_10_0 iOS 10.0 + \value MV_TVOS tvOS (any) + \value MV_TVOS_9_0 tvOS 9.0 + \value MV_TVOS_9_1 tvOS 9.1 + \value MV_TVOS_9_2 tvOS 9.2 + \value MV_TVOS_10_0 tvOS 10.0 + \value MV_None Not a Darwin operating system \sa WinVersion @@ -1241,7 +1247,7 @@ bool qSharedBuild() Q_DECL_NOTHROW \macro Q_OS_DARWIN \relates - Defined on Darwin-based operating systems such as OS X, iOS, watchOS, and tvOS. + Defined on Darwin-based operating systems such as macOS, iOS, watchOS, and tvOS. */ /*! @@ -1957,6 +1963,8 @@ static const char *osxVer_helper(QAppleOperatingSystemVersion version = qt_apple return "Yosemite"; case 11: return "El Capitan"; + case 12: + return "Sierra"; } } // unknown, future version @@ -2623,7 +2631,7 @@ QString QSysInfo::kernelVersion() to determine the distribution name and returns that. If determining the distribution name failed, it returns "unknown". - \b{Darwin, OS X, iOS and tvOS note}: this function returns "macos" for macOS + \b{Darwin, macOS, iOS and tvOS note}: this function returns "macos" for macOS systems, "ios" for iOS systems, "tvos" for tvOS systems and "darwin" in case the system could not be determined. @@ -2750,7 +2758,10 @@ QString QSysInfo::prettyProductName() const QAppleOperatingSystemVersion version = qt_apple_os_version(); const char *name = osxVer_helper(version); if (name) { - return QLatin1String("OS X ") + QLatin1String(name) + return (version.major == 10 && version.minor < 12 + ? QLatin1String("OS X ") + : QLatin1String("macOS ")) + + QLatin1String(name) + QLatin1String(" (") + QString::number(version.major) + QLatin1Char('.') + QString::number(version.minor) + QLatin1Char(')'); diff --git a/src/corelib/global/qsysinfo.h b/src/corelib/global/qsysinfo.h index 220535bb9d..31d78bca50 100644 --- a/src/corelib/global/qsysinfo.h +++ b/src/corelib/global/qsysinfo.h @@ -180,7 +180,9 @@ public: /* tvOS */ MV_TVOS = 1 << 9, MV_TVOS_9_0 = Q_MV_TVOS(9, 0), - MV_TVOS_9_1 = Q_MV_TVOS(9, 1) + MV_TVOS_9_1 = Q_MV_TVOS(9, 1), + MV_TVOS_9_2 = Q_MV_TVOS(9, 2), + MV_TVOS_10_0 = Q_MV_TVOS(10, 0) }; #if defined(Q_OS_MAC) static const MacVersion MacintoshVersion; diff --git a/src/corelib/global/qsystemdetection.h b/src/corelib/global/qsystemdetection.h index 3dd2134f77..90954b1eca 100644 --- a/src/corelib/global/qsystemdetection.h +++ b/src/corelib/global/qsystemdetection.h @@ -47,7 +47,7 @@ /* The operating system, must be one of: (Q_OS_x) - DARWIN - Any Darwin system (OS X, iOS, watchOS, tvOS) + DARWIN - Any Darwin system (macOS, iOS, watchOS, tvOS) MACOS - macOS IOS - iOS WATCHOS - watchOS @@ -115,8 +115,8 @@ # endif # endif # else -# // there is no "real" OS X define (rdar://22640089), -# // assume any non iOS-based platform is OS X for now +# // TARGET_OS_OSX is only available in newer SDKs, +# // so assume any non iOS-based platform is macOS for now # define Q_OS_MACOS # endif # else -- cgit v1.2.3