Remove qMacVersion()
authorBradley T. Hughes <bradley.hughes@nokia.com>
Mon, 20 Feb 2012 08:43:02 +0000 (09:43 +0100)
committerQt by Nokia <qt-info@nokia.com>
Tue, 21 Feb 2012 11:48:04 +0000 (12:48 +0100)
Add QSysInfo::macVersion() instead, to match the windowsVersion()
function.

Change-Id: I783e59583ca21653d25586156cbb0cb1f301868b
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
dist/changes-5.0.0
src/corelib/global/qglobal.cpp
src/corelib/global/qglobal.h
src/widgets/styles/qmacstyle_mac.mm
tests/baselineserver/shared/baselineprotocol.cpp

index 662226d..2f34ca5 100644 (file)
@@ -216,6 +216,9 @@ information about a particular change.
 
 - QSqlQueryModel::indexInQuery() is now virtual. See note below under QSql.
 
+- qMacVersion() has been removed. Use QSysInfo::macVersion() or
+  QSysInfo::MacintoshVersion instead.
+
 ****************************************************************************
 *                           General                                        *
 ****************************************************************************
index eea4397..6257376 100644 (file)
@@ -819,15 +819,6 @@ QT_BEGIN_NAMESPACE
 */
 
 /*!
-    \fn int qMacVersion()
-    \relates <QtGlobal>
-
-    Use QSysInfo::MacintoshVersion instead.
-
-    \sa QSysInfo
-*/
-
-/*!
     \macro QT_VERSION_CHECK
     \relates <QtGlobal>
 
@@ -949,6 +940,13 @@ bool qSharedBuild()
 */
 
 /*!
+    \fn QSysInfo::MacVersion QSysInfo::macVersion()
+
+    Returns the version of Mac OS X on which the application is run (Mac OS X
+    Only).
+*/
+
+/*!
     \enum QSysInfo::Endian
 
     \value BigEndian  Big-endian byte order (also called Network byte order)
@@ -1630,7 +1628,7 @@ Q_CORE_EXPORT QString qt_mac_from_pascal_string(const Str255 pstr) {
 
 #if defined(Q_OS_MAC)
 
-static QSysInfo::MacVersion macVersion()
+QSysInfo::MacVersion QSysInfo::macVersion()
 {
 #ifndef QT_NO_CORESERVICES
     SInt32 gestalt_version;
@@ -1640,7 +1638,7 @@ static QSysInfo::MacVersion macVersion()
 #endif
     return QSysInfo::MV_Unknown;
 }
-const QSysInfo::MacVersion QSysInfo::MacintoshVersion = macVersion();
+const QSysInfo::MacVersion QSysInfo::MacintoshVersion = QSysInfo::macVersion();
 
 #elif defined(Q_OS_WIN) || defined(Q_OS_CYGWIN) || defined(Q_OS_WINCE)
 
index d4d2ffd..b7ff270 100644 (file)
@@ -941,16 +941,13 @@ public:
         MV_LION = MV_10_7
     };
     static const MacVersion MacintoshVersion;
+    static MacVersion macVersion();
 #endif
 };
 
 Q_CORE_EXPORT const char *qVersion();
 Q_CORE_EXPORT bool qSharedBuild();
 
-#if defined(Q_OS_MAC)
-inline int qMacVersion() { return QSysInfo::MacintoshVersion; }
-#endif
-
 #ifndef Q_OUTOFLINE_TEMPLATE
 #  define Q_OUTOFLINE_TEMPLATE
 #endif
index 09cb9cc..1f91fa4 100644 (file)
@@ -5092,7 +5092,7 @@ void QMacStyle::drawComplexControl(ComplexControl cc, const QStyleOptionComplex
                 uint sc = SC_TitleBarMinButton;
                 ThemeTitleBarWidget tbw = kThemeWidgetCollapseBox;
                 bool active = titlebar->state & State_Active;
-                if (qMacVersion() < QSysInfo::MV_10_6) {
+                if (QSysInfo::macVersion() < QSysInfo::MV_10_6) {
                     int border = 2;
                     titleBarRect.origin.x += border;
                     titleBarRect.origin.y -= border;
index 0a74ed6..9fcd995 100644 (file)
@@ -110,7 +110,7 @@ PlatformInfo PlatformInfo::localHostInfo()
     pi.insert(PI_OSVersion, QString::number(QSysInfo::windowsVersion()));
 #elif defined(Q_OS_MAC)
     pi.insert(PI_OSName, QLS("MacOS"));
-    pi.insert(PI_OSVersion, QString::number(qMacVersion()));
+    pi.insert(PI_OSVersion, QString::number(QSysInfo::macVersion()));
 #else
     pi.insert(PI_OSName, QLS("Other"));
 #endif