From 6bf759b31040fb5d05044cd14d5889fbd19a8942 Mon Sep 17 00:00:00 2001 From: John Layt Date: Mon, 11 Nov 2013 13:30:44 +0100 Subject: QTimeZone - Change Olsen ID to IANA ID The name Olson was misspelled as Olsen in the public api of QTimeZone which is needed to be fixed before first public release in 5.2 would freeze the api and prevent it being fixed. It has been decided that renaming as IANA ID would be more future-proof. Fixes to the private code will be done separately to keep this patch against release branch to the minimum required. Task-number: QTBUG-34735 Change-Id: I8ee90644862c907f6d1937b8536f0c02583ae736 Reviewed-by: Thiago Macieira Reviewed-by: Lars Knoll --- src/corelib/tools/qtimezone.cpp | 111 +++++++++++---------- src/corelib/tools/qtimezone.h | 14 +-- src/corelib/tools/qtimezoneprivate.cpp | 12 +-- src/corelib/tools/qtimezoneprivate_p.h | 10 +- src/corelib/tools/qtimezoneprivate_win.cpp | 8 +- .../auto/corelib/tools/qtimezone/tst_qtimezone.cpp | 36 +++---- 6 files changed, 97 insertions(+), 94 deletions(-) diff --git a/src/corelib/tools/qtimezone.cpp b/src/corelib/tools/qtimezone.cpp index 9288dc7756..37d6e183a7 100644 --- a/src/corelib/tools/qtimezone.cpp +++ b/src/corelib/tools/qtimezone.cpp @@ -105,7 +105,7 @@ public: QTimeZoneSingleton() : backend(newBackendTimeZone()) {} // The backend_tz is the tz to use in static methods such as availableTimeZoneIds() and - // isTimeZoneIdAvailable() and to create named Olsen time zones. This is usually the host + // isTimeZoneIdAvailable() and to create named IANA time zones. This is usually the host // system, but may be different if the host resources are insufficient or if // QT_NO_SYSTEMLOCALE is set. A simple UTC backend is used if no alternative is available. QSharedDataPointer backend; @@ -135,18 +135,21 @@ Q_GLOBAL_STATIC(QTimeZoneSingleton, global_tz); \section1 - \section2 Olsen Time Zone IDs + \section2 IANA Time Zone IDs - QTimeZone uses the Olsen time zone IDs as defined in the IANA Time Zone + QTimeZone uses the IANA time zone IDs as defined in the IANA Time Zone Database (http://www.iana.org/time-zones). This is to ensure a standard ID - across all supported platforms. Most platforms support the Olsen IDs + across all supported platforms. Most platforms support the IANA IDs and the IANA Database natively, but for Windows a mapping is required to the native IDs. See below for more details. - The Olsen IDs can and do change on a regular basis, and can vary depending + The IANA IDs can and do change on a regular basis, and can vary depending on how recently the host system data was updated. As such you cannot rely on any given ID existing on any host system. You must use - availableTimeZoneIds() to determine what Olsen IDs are available. + availableTimeZoneIds() to determine what IANA IDs are available. + + The IANA IDs and database are also know as the Olson IDs and database, + named after their creator. \section2 UTC Offset Time Zones @@ -165,7 +168,7 @@ Q_GLOBAL_STATIC(QTimeZoneSingleton, global_tz); the current year. QTimeZone uses a conversion table derived form the Unicode CLDR data to map - between Olsen IDs and Windows IDs. Depending on your version of Windows + between IANA IDs and Windows IDs. Depending on your version of Windows and Qt, this table may not be able to provide a valid conversion, in which "UTC" will be returned. @@ -180,7 +183,7 @@ Q_GLOBAL_STATIC(QTimeZoneSingleton, global_tz); If you require a QDateTime that uses the current system time zone at any given moment then you should use a Qt::TimeSpec of Qt::LocalTime. - The method systemTimeZoneId() returns the current system Olsen time zone + The method systemTimeZoneId() returns the current system IANA time zone ID which on OSX and Linux will always be correct. On Windows this ID is translated from the the Windows system ID using an internal translation table and the user's selected country. As a consequence there is a small @@ -323,7 +326,7 @@ QTimeZone::QTimeZone() } /*! - Creates an instance of the requested time zone \a olsenId. + Creates an instance of the requested time zone \a ianaId. The ID must be one of the available system IDs otherwise an invalid time zone will be returned. @@ -331,14 +334,14 @@ QTimeZone::QTimeZone() \sa availableTimeZoneIds() */ -QTimeZone::QTimeZone(const QByteArray &olsenId) +QTimeZone::QTimeZone(const QByteArray &ianaId) { // Try and see if it's a valid UTC offset ID, just as quick to try create as look-up - d = new QUtcTimeZonePrivate(olsenId); + d = new QUtcTimeZonePrivate(ianaId); // If not a valid UTC offset ID then try create it with the system backend // Relies on backend not creating valid tz with invalid name if (!d->isValid()) - d = newBackendTimeZone(olsenId); + d = newBackendTimeZone(ianaId); } /*! @@ -359,14 +362,14 @@ QTimeZone::QTimeZone(int offsetSeconds) } /*! - Creates a custom time zone with an ID of \a olsenId and an offset from UTC + Creates a custom time zone with an ID of \a ianaId and an offset from UTC of \a offsetSeconds. The \a name will be the name used by displayName() for the LongName, the \a abbreviation will be used by displayName() for the ShortName and by abbreviation(), and the optional \a country will be used by country(). The \a comment is an optional note that may be displayed in a GUI to assist users in selecting a time zone. - The \a olsenId must not be one of the available system IDs returned by + The \a ianaId must not be one of the available system IDs returned by availableTimeZoneIds(). The \a offsetSeconds from UTC must be in the range -14 hours to +14 hours. @@ -374,12 +377,12 @@ QTimeZone::QTimeZone(int offsetSeconds) default value of QLocale::AnyCountry. */ -QTimeZone::QTimeZone(const QByteArray &olsenId, int offsetSeconds, const QString &name, +QTimeZone::QTimeZone(const QByteArray &ianaId, int offsetSeconds, const QString &name, const QString &abbreviation, QLocale::Country country, const QString &comment) { - // olsenId must be a valid ID and must not clash with the standard system names - if (QTimeZonePrivate::isValidId(olsenId) && !availableTimeZoneIds().contains(olsenId)) - d = new QUtcTimeZonePrivate(olsenId, offsetSeconds, name, abbreviation, country, comment); + // ianaId must be a valid ID and must not clash with the standard system names + if (QTimeZonePrivate::isValidId(ianaId) && !availableTimeZoneIds().contains(ianaId)) + d = new QUtcTimeZonePrivate(ianaId, offsetSeconds, name, abbreviation, country, comment); else d = 0; } @@ -473,10 +476,10 @@ bool QTimeZone::isValid() const } /*! - Returns the Olsen ID for the time zone. + Returns the IANA ID for the time zone. - Olsen IDs are used on all platforms. On Windows these are translated - from the Windows ID into the closest Olsen ID for the time zone and country. + IANA IDs are used on all platforms. On Windows these are translated + from the Windows ID into the closest IANA ID for the time zone and country. */ QByteArray QTimeZone::id() const @@ -760,7 +763,7 @@ QTimeZone::OffsetDataList QTimeZone::transitions(const QDateTime &fromDateTime, // Static methods /*! - Returns the current system time zone Olsen ID. + Returns the current system time zone IANA ID. On Windows this ID is translated from the the Windows ID using an internal translation table and the user's selected country. As a consequence there @@ -774,20 +777,20 @@ QByteArray QTimeZone::systemTimeZoneId() } /*! - Returns \c true if a given time zone \a olsenId is available on this system. + Returns \c true if a given time zone \a ianaId is available on this system. \sa availableTimeZoneIds() */ -bool QTimeZone::isTimeZoneIdAvailable(const QByteArray &olsenId) +bool QTimeZone::isTimeZoneIdAvailable(const QByteArray &ianaId) { // isValidId is not strictly required, but faster to weed out invalid // IDs as availableTimeZoneIds() may be slow - return (QTimeZonePrivate::isValidId(olsenId) && (availableTimeZoneIds().contains(olsenId))); + return (QTimeZonePrivate::isValidId(ianaId) && (availableTimeZoneIds().contains(ianaId))); } /*! - Returns a list of all available Olsen time zone IDs on this system. + Returns a list of all available IANA time zone IDs on this system. \sa isTimeZoneIdAvailable() */ @@ -802,7 +805,7 @@ QList QTimeZone::availableTimeZoneIds() } /*! - Returns a list of all available Olsen time zone IDs for a given \a country. + Returns a list of all available IANA time zone IDs for a given \a country. As a special case, a \a country of Qt::AnyCountry returns those time zones that do not have any country related to them, such as UTC. If you require @@ -822,7 +825,7 @@ QList QTimeZone::availableTimeZoneIds(QLocale::Country country) } /*! - Returns a list of all available Olsen time zone IDs with a given standard + Returns a list of all available IANA time zone IDs with a given standard time offset of \a offsetSeconds. \sa isTimeZoneIdAvailable() @@ -838,79 +841,79 @@ QList QTimeZone::availableTimeZoneIds(int offsetSeconds) } /*! - Returns the Windows ID equivalent to the given \a olsenId. + Returns the Windows ID equivalent to the given \a ianaId. - \sa windowsIdToDefaultOlsenId(), windowsIdToOlsenIds() + \sa windowsIdToDefaultIanaId(), windowsIdToIanaIds() */ -QByteArray QTimeZone::olsenIdToWindowsId(const QByteArray &olsenId) +QByteArray QTimeZone::ianaIdToWindowsId(const QByteArray &ianaId) { - return QTimeZonePrivate::olsenIdToWindowsId(olsenId); + return QTimeZonePrivate::ianaIdToWindowsId(ianaId); } /*! - Returns the default Olsen ID for a given \a windowsId. + Returns the default IANA ID for a given \a windowsId. - Because a Windows ID can cover several Olsen IDs in several different - countries, this function returns the most frequently used Olsen ID with no + Because a Windows ID can cover several IANA IDs in several different + countries, this function returns the most frequently used IANA ID with no regard for the country and should thus be used with care. It is usually best to request the default for a specific country. - \sa olsenIdToWindowsId(), windowsIdToOlsenIds() + \sa ianaIdToWindowsId(), windowsIdToIanaIds() */ -QByteArray QTimeZone::windowsIdToDefaultOlsenId(const QByteArray &windowsId) +QByteArray QTimeZone::windowsIdToDefaultIanaId(const QByteArray &windowsId) { - return QTimeZonePrivate::windowsIdToDefaultOlsenId(windowsId); + return QTimeZonePrivate::windowsIdToDefaultIanaId(windowsId); } /*! - Returns the default Olsen ID for a given \a windowsId and \a country. + Returns the default IANA ID for a given \a windowsId and \a country. - Because a Windows ID can cover several Olsen IDs within a given country, - the most frequently used Olsen ID in that country is returned. + Because a Windows ID can cover several IANA IDs within a given country, + the most frequently used IANA ID in that country is returned. - As a special case, QLocale::AnyCountry returns the default of those Olsen IDs + As a special case, QLocale::AnyCountry returns the default of those IANA IDs that do not have any specific country. - \sa olsenIdToWindowsId(), windowsIdToOlsenIds() + \sa ianaIdToWindowsId(), windowsIdToIanaIds() */ -QByteArray QTimeZone::windowsIdToDefaultOlsenId(const QByteArray &windowsId, +QByteArray QTimeZone::windowsIdToDefaultIanaId(const QByteArray &windowsId, QLocale::Country country) { - return QTimeZonePrivate::windowsIdToDefaultOlsenId(windowsId, country); + return QTimeZonePrivate::windowsIdToDefaultIanaId(windowsId, country); } /*! - Returns all the Olsen IDs for a given \a windowsId. + Returns all the IANA IDs for a given \a windowsId. The returned list is sorted alphabetically. - \sa olsenIdToWindowsId(), windowsIdToDefaultOlsenId() + \sa ianaIdToWindowsId(), windowsIdToDefaultIanaId() */ -QList QTimeZone::windowsIdToOlsenIds(const QByteArray &windowsId) +QList QTimeZone::windowsIdToIanaIds(const QByteArray &windowsId) { - return QTimeZonePrivate::windowsIdToOlsenIds(windowsId); + return QTimeZonePrivate::windowsIdToIanaIds(windowsId); } /*! - Returns all the Olsen IDs for a given \a windowsId and \a country. + Returns all the IANA IDs for a given \a windowsId and \a country. - As a special case QLocale::AnyCountry returns those Olsen IDs that do + As a special case QLocale::AnyCountry returns those IANA IDs that do not have any specific country. The returned list is in order of frequency of usage, i.e. larger zones within a country are listed first. - \sa olsenIdToWindowsId(), windowsIdToDefaultOlsenId() + \sa ianaIdToWindowsId(), windowsIdToDefaultIanaId() */ -QList QTimeZone::windowsIdToOlsenIds(const QByteArray &windowsId, +QList QTimeZone::windowsIdToIanaIds(const QByteArray &windowsId, QLocale::Country country) { - return QTimeZonePrivate::windowsIdToOlsenIds(windowsId, country); + return QTimeZonePrivate::windowsIdToIanaIds(windowsId, country); } #ifndef QT_NO_DATASTREAM diff --git a/src/corelib/tools/qtimezone.h b/src/corelib/tools/qtimezone.h index cbc4f3e4ad..b038d66a65 100644 --- a/src/corelib/tools/qtimezone.h +++ b/src/corelib/tools/qtimezone.h @@ -77,7 +77,7 @@ public: typedef QVector OffsetDataList; QTimeZone(); - explicit QTimeZone(const QByteArray &olsenId); + explicit QTimeZone(const QByteArray &ianaId); explicit QTimeZone(int offsetSeconds); /*implicit*/ QTimeZone(const QByteArray &zoneId, int offsetSeconds, const QString &name, const QString &abbreviation, QLocale::Country country = QLocale::AnyCountry, @@ -126,18 +126,18 @@ public: static QByteArray systemTimeZoneId(); - static bool isTimeZoneIdAvailable(const QByteArray &olsenId); + static bool isTimeZoneIdAvailable(const QByteArray &ianaId); static QList availableTimeZoneIds(); static QList availableTimeZoneIds(QLocale::Country country); static QList availableTimeZoneIds(int offsetSeconds); - static QByteArray olsenIdToWindowsId(const QByteArray &olsenId); - static QByteArray windowsIdToDefaultOlsenId(const QByteArray &windowsId); - static QByteArray windowsIdToDefaultOlsenId(const QByteArray &windowsId, + static QByteArray ianaIdToWindowsId(const QByteArray &ianaId); + static QByteArray windowsIdToDefaultIanaId(const QByteArray &windowsId); + static QByteArray windowsIdToDefaultIanaId(const QByteArray &windowsId, QLocale::Country country); - static QList windowsIdToOlsenIds(const QByteArray &windowsId); - static QList windowsIdToOlsenIds(const QByteArray &windowsId, + static QList windowsIdToIanaIds(const QByteArray &windowsId); + static QList windowsIdToIanaIds(const QByteArray &windowsId, QLocale::Country country); private: diff --git a/src/corelib/tools/qtimezoneprivate.cpp b/src/corelib/tools/qtimezoneprivate.cpp index 8d5d60bf37..cbf731a19e 100644 --- a/src/corelib/tools/qtimezoneprivate.cpp +++ b/src/corelib/tools/qtimezoneprivate.cpp @@ -477,7 +477,7 @@ QString QTimeZonePrivate::isoOffsetFormat(int offsetFromUtc) .arg(qAbs(mins) % 60, 2, 10, QLatin1Char('0')); } -QByteArray QTimeZonePrivate::olsenIdToWindowsId(const QByteArray &id) +QByteArray QTimeZonePrivate::ianaIdToWindowsId(const QByteArray &id) { for (int i = 0; i < zoneDataTableSize; ++i) { const QZoneData *data = zoneData(i); @@ -487,7 +487,7 @@ QByteArray QTimeZonePrivate::olsenIdToWindowsId(const QByteArray &id) return QByteArray(); } -QByteArray QTimeZonePrivate::windowsIdToDefaultOlsenId(const QByteArray &windowsId) +QByteArray QTimeZonePrivate::windowsIdToDefaultIanaId(const QByteArray &windowsId) { const quint16 windowsIdKey = toWindowsIdKey(windowsId); for (int i = 0; i < windowsDataTableSize; ++i) { @@ -498,17 +498,17 @@ QByteArray QTimeZonePrivate::windowsIdToDefaultOlsenId(const QByteArray &windows return QByteArray(); } -QByteArray QTimeZonePrivate::windowsIdToDefaultOlsenId(const QByteArray &windowsId, +QByteArray QTimeZonePrivate::windowsIdToDefaultIanaId(const QByteArray &windowsId, QLocale::Country country) { - const QList list = windowsIdToOlsenIds(windowsId, country); + const QList list = windowsIdToIanaIds(windowsId, country); if (list.count() > 0) return list.first(); else return QByteArray(); } -QList QTimeZonePrivate::windowsIdToOlsenIds(const QByteArray &windowsId) +QList QTimeZonePrivate::windowsIdToIanaIds(const QByteArray &windowsId) { const quint16 windowsIdKey = toWindowsIdKey(windowsId); QList list; @@ -524,7 +524,7 @@ QList QTimeZonePrivate::windowsIdToOlsenIds(const QByteArray &window return list; } -QList QTimeZonePrivate::windowsIdToOlsenIds(const QByteArray &windowsId, +QList QTimeZonePrivate::windowsIdToIanaIds(const QByteArray &windowsId, QLocale::Country country) { const quint16 windowsIdKey = toWindowsIdKey(windowsId); diff --git a/src/corelib/tools/qtimezoneprivate_p.h b/src/corelib/tools/qtimezoneprivate_p.h index 9f99f49fcf..186a352a2f 100644 --- a/src/corelib/tools/qtimezoneprivate_p.h +++ b/src/corelib/tools/qtimezoneprivate_p.h @@ -146,12 +146,12 @@ public: static bool isValidId(const QByteArray &olsenId); static QString isoOffsetFormat(int offsetFromUtc); - static QByteArray olsenIdToWindowsId(const QByteArray &olsenId); - static QByteArray windowsIdToDefaultOlsenId(const QByteArray &windowsId); - static QByteArray windowsIdToDefaultOlsenId(const QByteArray &windowsId, + static QByteArray ianaIdToWindowsId(const QByteArray &ianaId); + static QByteArray windowsIdToDefaultIanaId(const QByteArray &windowsId); + static QByteArray windowsIdToDefaultIanaId(const QByteArray &windowsId, QLocale::Country country); - static QList windowsIdToOlsenIds(const QByteArray &windowsId); - static QList windowsIdToOlsenIds(const QByteArray &windowsId, + static QList windowsIdToIanaIds(const QByteArray &windowsId); + static QList windowsIdToIanaIds(const QByteArray &windowsId, QLocale::Country country); protected: diff --git a/src/corelib/tools/qtimezoneprivate_win.cpp b/src/corelib/tools/qtimezoneprivate_win.cpp index f411d35b3d..55949128ae 100644 --- a/src/corelib/tools/qtimezoneprivate_win.cpp +++ b/src/corelib/tools/qtimezoneprivate_win.cpp @@ -362,7 +362,7 @@ void QWinTimeZonePrivate::init(const QByteArray &olsenId) m_windowsId = windowsSystemZoneId(); m_id = systemTimeZoneId(); } else { - m_windowsId = olsenIdToWindowsId(olsenId); + m_windowsId = ianaIdToWindowsId(olsenId); m_id = olsenId; } @@ -620,10 +620,10 @@ QByteArray QWinTimeZonePrivate::systemTimeZoneId() const QByteArray olsenId; // If we have a real country, then try get a specific match for that country if (country != QLocale::AnyCountry) - olsenId = windowsIdToDefaultOlsenId(windowsId, country); + olsenId = windowsIdToDefaultIanaId(windowsId, country); // If we don't have a real country, or there wasn't a specific match, try the global default if (olsenId.isEmpty()) { - olsenId = windowsIdToDefaultOlsenId(windowsId); + olsenId = windowsIdToDefaultIanaId(windowsId); // If no global default then probably an unknown Windows ID so return UTC if (olsenId.isEmpty()) return QByteArrayLiteral("UTC"); @@ -635,7 +635,7 @@ QSet QWinTimeZonePrivate::availableTimeZoneIds() const { QSet set; foreach (const QByteArray &winId, availableWindowsIds()) { - foreach (const QByteArray &olsenId, windowsIdToOlsenIds(winId)) + foreach (const QByteArray &olsenId, windowsIdToIanaIds(winId)) set << olsenId; } return set; diff --git a/tests/auto/corelib/tools/qtimezone/tst_qtimezone.cpp b/tests/auto/corelib/tools/qtimezone/tst_qtimezone.cpp index ed08bcefbf..ac8530bd54 100644 --- a/tests/auto/corelib/tools/qtimezone/tst_qtimezone.cpp +++ b/tests/auto/corelib/tools/qtimezone/tst_qtimezone.cpp @@ -371,7 +371,7 @@ void tst_QTimeZone::windowsId() { /* Current Windows zones for "Central Standard Time": - Region Olsen Id(s) + Region IANA Id(s) Default "America/Chicago" Canada "America/Winnipeg America/Rainy_River America/Rankin_Inlet America/Resolute" Mexico "America/Matamoros" @@ -380,24 +380,24 @@ void tst_QTimeZone::windowsId() "America/North_Dakota/New_Salem" AnyCountry "CST6CDT" */ - QCOMPARE(QTimeZone::olsenIdToWindowsId("America/Chicago"), + QCOMPARE(QTimeZone::ianaIdToWindowsId("America/Chicago"), QByteArray("Central Standard Time")); - QCOMPARE(QTimeZone::olsenIdToWindowsId("America/Resolute"), + QCOMPARE(QTimeZone::ianaIdToWindowsId("America/Resolute"), QByteArray("Central Standard Time")); // Partials shouldn't match - QCOMPARE(QTimeZone::olsenIdToWindowsId("America/Chi"), QByteArray()); - QCOMPARE(QTimeZone::olsenIdToWindowsId("InvalidZone"), QByteArray()); - QCOMPARE(QTimeZone::olsenIdToWindowsId(QByteArray()), QByteArray()); + QCOMPARE(QTimeZone::ianaIdToWindowsId("America/Chi"), QByteArray()); + QCOMPARE(QTimeZone::ianaIdToWindowsId("InvalidZone"), QByteArray()); + QCOMPARE(QTimeZone::ianaIdToWindowsId(QByteArray()), QByteArray()); // Check default value - QCOMPARE(QTimeZone::windowsIdToDefaultOlsenId("Central Standard Time"), + QCOMPARE(QTimeZone::windowsIdToDefaultIanaId("Central Standard Time"), QByteArray("America/Chicago")); - QCOMPARE(QTimeZone::windowsIdToDefaultOlsenId("Central Standard Time", QLocale::Canada), + QCOMPARE(QTimeZone::windowsIdToDefaultIanaId("Central Standard Time", QLocale::Canada), QByteArray("America/Winnipeg")); - QCOMPARE(QTimeZone::windowsIdToDefaultOlsenId("Central Standard Time", QLocale::AnyCountry), + QCOMPARE(QTimeZone::windowsIdToDefaultIanaId("Central Standard Time", QLocale::AnyCountry), QByteArray("CST6CDT")); - QCOMPARE(QTimeZone::windowsIdToDefaultOlsenId(QByteArray()), QByteArray()); + QCOMPARE(QTimeZone::windowsIdToDefaultIanaId(QByteArray()), QByteArray()); // No country is sorted list of all zones QList list; @@ -406,39 +406,39 @@ void tst_QTimeZone::windowsId() << "America/North_Dakota/Center" << "America/North_Dakota/New_Salem" << "America/Rainy_River" << "America/Rankin_Inlet" << "America/Resolute" << "America/Winnipeg" << "CST6CDT"; - QCOMPARE(QTimeZone::windowsIdToOlsenIds("Central Standard Time"), list); + QCOMPARE(QTimeZone::windowsIdToIanaIds("Central Standard Time"), list); // Check country with no match returns empty list list.clear(); - QCOMPARE(QTimeZone::windowsIdToOlsenIds("Central Standard Time", QLocale::NewZealand), + QCOMPARE(QTimeZone::windowsIdToIanaIds("Central Standard Time", QLocale::NewZealand), list); // Check valid country returns list in preference order list.clear(); list << "America/Winnipeg" << "America/Rainy_River" << "America/Rankin_Inlet" << "America/Resolute"; - QCOMPARE(QTimeZone::windowsIdToOlsenIds("Central Standard Time", QLocale::Canada), list); + QCOMPARE(QTimeZone::windowsIdToIanaIds("Central Standard Time", QLocale::Canada), list); list.clear(); list << "America/Matamoros"; - QCOMPARE(QTimeZone::windowsIdToOlsenIds("Central Standard Time", QLocale::Mexico), list); + QCOMPARE(QTimeZone::windowsIdToIanaIds("Central Standard Time", QLocale::Mexico), list); list.clear(); list << "America/Chicago" << "America/Indiana/Knox" << "America/Indiana/Tell_City" << "America/Menominee" << "America/North_Dakota/Beulah" << "America/North_Dakota/Center" << "America/North_Dakota/New_Salem"; - QCOMPARE(QTimeZone::windowsIdToOlsenIds("Central Standard Time", QLocale::UnitedStates), + QCOMPARE(QTimeZone::windowsIdToIanaIds("Central Standard Time", QLocale::UnitedStates), list); list.clear(); list << "CST6CDT"; - QCOMPARE(QTimeZone::windowsIdToOlsenIds("Central Standard Time", QLocale::AnyCountry), + QCOMPARE(QTimeZone::windowsIdToIanaIds("Central Standard Time", QLocale::AnyCountry), list); // Check no windowsId return empty list.clear(); - QCOMPARE(QTimeZone::windowsIdToOlsenIds(QByteArray()), list); - QCOMPARE(QTimeZone::windowsIdToOlsenIds(QByteArray(), QLocale::AnyCountry), list); + QCOMPARE(QTimeZone::windowsIdToIanaIds(QByteArray()), list); + QCOMPARE(QTimeZone::windowsIdToIanaIds(QByteArray(), QLocale::AnyCountry), list); } void tst_QTimeZone::utcTest() -- cgit v1.2.3