summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJake Petroules <jake.petroules@petroules.com>2014-05-30 22:10:53 (GMT)
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-05-31 18:25:36 (GMT)
commitea0ab2cdec43fc64b5b1380b3441ab68e3eec3bc (patch)
treea11c833178d610387c96bdf7301a56ca0f1bb086 /src
parent01f42466d37dbbdedd0c2386f2b83c3bc7c3873b (diff)
downloadQt-ea0ab2cdec43fc64b5b1380b3441ab68e3eec3bc.zip
Qt-ea0ab2cdec43fc64b5b1380b3441ab68e3eec3bc.tar.gz
Qt-ea0ab2cdec43fc64b5b1380b3441ab68e3eec3bc.tar.bz2
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). (backported from qtbase/42f9a61608fe662e797dc6541f4e82c19b878d56) Change-Id: I329355135e82d0e57d9b70a93a62a5f086aa0955 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src')
-rw-r--r--src/corelib/global/qglobal.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/corelib/global/qglobal.cpp b/src/corelib/global/qglobal.cpp
index c4fa4dd..45ebc00 100644
--- a/src/corelib/global/qglobal.cpp
+++ b/src/corelib/global/qglobal.cpp
@@ -1674,8 +1674,9 @@ static QSysInfo::MacVersion macVersion()
{
#if !defined(Q_OS_IOS)
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);
}
#endif
return QSysInfo::MV_Unknown;