From: Bradley T. Hughes Date: Mon, 20 Feb 2012 08:43:02 +0000 (+0100) Subject: Remove qMacVersion() X-Git-Tag: qt-v5.0.0-alpha1~904 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=84438a77ccff294aa8b63dc6b5b11a58cdca0c12;p=profile%2Fivi%2Fqtbase.git Remove qMacVersion() Add QSysInfo::macVersion() instead, to match the windowsVersion() function. Change-Id: I783e59583ca21653d25586156cbb0cb1f301868b Reviewed-by: Lars Knoll --- diff --git a/dist/changes-5.0.0 b/dist/changes-5.0.0 index 662226d..2f34ca5 100644 --- a/dist/changes-5.0.0 +++ b/dist/changes-5.0.0 @@ -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 * **************************************************************************** diff --git a/src/corelib/global/qglobal.cpp b/src/corelib/global/qglobal.cpp index eea4397..6257376 100644 --- a/src/corelib/global/qglobal.cpp +++ b/src/corelib/global/qglobal.cpp @@ -819,15 +819,6 @@ QT_BEGIN_NAMESPACE */ /*! - \fn int qMacVersion() - \relates - - Use QSysInfo::MacintoshVersion instead. - - \sa QSysInfo -*/ - -/*! \macro QT_VERSION_CHECK \relates @@ -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) diff --git a/src/corelib/global/qglobal.h b/src/corelib/global/qglobal.h index d4d2ffd..b7ff270 100644 --- a/src/corelib/global/qglobal.h +++ b/src/corelib/global/qglobal.h @@ -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 diff --git a/src/widgets/styles/qmacstyle_mac.mm b/src/widgets/styles/qmacstyle_mac.mm index 09cb9cc..1f91fa4 100644 --- a/src/widgets/styles/qmacstyle_mac.mm +++ b/src/widgets/styles/qmacstyle_mac.mm @@ -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; diff --git a/tests/baselineserver/shared/baselineprotocol.cpp b/tests/baselineserver/shared/baselineprotocol.cpp index 0a74ed6..9fcd995 100644 --- a/tests/baselineserver/shared/baselineprotocol.cpp +++ b/tests/baselineserver/shared/baselineprotocol.cpp @@ -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