From 42f9a61608fe662e797dc6541f4e82c19b878d56 Mon Sep 17 00:00:00 2001 From: Jake Petroules Date: Fri, 30 May 2014 17:56:03 -0400 Subject: Fix QSysInfo::macVersion for OS X minor versions greater than 9. gestaltSystemVersion's encoding only has room for a single version digit. Thus, OS X 10.10 would previously have been detected as OS X 10.9 (Apple's comments in the header even warn against this). Change-Id: I41c35b1507d39e2958a9aaffaa8c48ac380f61d9 Reviewed-by: Samuel Gaist Reviewed-by: Thiago Macieira --- src/corelib/global/qglobal.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/corelib/global') diff --git a/src/corelib/global/qglobal.cpp b/src/corelib/global/qglobal.cpp index 66664f0f2a..d7c166721e 100644 --- a/src/corelib/global/qglobal.cpp +++ b/src/corelib/global/qglobal.cpp @@ -1770,8 +1770,9 @@ QSysInfo::MacVersion QSysInfo::macVersion() { #if defined(Q_OS_OSX) SInt32 gestalt_version; - if (Gestalt(gestaltSystemVersion, &gestalt_version) == noErr) { - return QSysInfo::MacVersion(((gestalt_version & 0x00F0) >> 4) + 2); + if (Gestalt(gestaltSystemVersionMinor, &gestalt_version) == noErr) { + // add 2 because OS X 10.0 is 0x02 in the enum + return QSysInfo::MacVersion(gestalt_version + 2); } #elif defined(Q_OS_IOS) return qt_ios_version(); // qtcore_mac_objc.mm -- cgit v1.2.3 From 64de8fb29dd43fd0f204e5b06236051512a9eef4 Mon Sep 17 00:00:00 2001 From: Maurice Kalinowski Date: Mon, 2 Jun 2014 09:40:08 +0200 Subject: add Windows 8.1 override Change-Id: Id8aa549e4ba5d8b550405823e26bb68da9403ced Reviewed-by: Oliver Wolff --- src/corelib/global/qglobal.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/corelib/global') diff --git a/src/corelib/global/qglobal.cpp b/src/corelib/global/qglobal.cpp index d7c166721e..6b5638d336 100644 --- a/src/corelib/global/qglobal.cpp +++ b/src/corelib/global/qglobal.cpp @@ -1922,6 +1922,8 @@ QSysInfo::WinVersion QSysInfo::windowsVersion() winver = QSysInfo::WV_WINDOWS7; else if (override == "WINDOWS8") winver = QSysInfo::WV_WINDOWS8; + else if (override == "WINDOWS8_1") + winver = QSysInfo::WV_WINDOWS8_1; } #endif #endif // !Q_OS_WINRT -- cgit v1.2.3