From a53312dad1fbb454f32f1481b8c79351fe6ea512 Mon Sep 17 00:00:00 2001 From: John Layt Date: Fri, 25 Oct 2013 22:54:21 +0200 Subject: QLocale - Fix Mac date format code translation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Mac uses the CLDR format codes which need to be translated into their Qt equivalent. The existing code mistranslates the year code, is outdated for a number of new codes introduced in recent versions of CLDR, and by default accepted any codes it didn't recognize. This change updates support to the latest version of CLDR, fixes the treatment of years, and defaults to ignoring any new format codes added in the future. Back-ported from qtbase/77dc33dcdbe0eec8ddc9059c4e0ff9dde264c5fa Task-number: QTBUG-25057 Change-Id: Ide040eca467cfada46fb0e2010db179a76b3096a Reviewed-by: Morten Johan Sørvig --- tests/auto/qlocale/tst_qlocale.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'tests') diff --git a/tests/auto/qlocale/tst_qlocale.cpp b/tests/auto/qlocale/tst_qlocale.cpp index 8e299b19bc..9cac40ffdb 100644 --- a/tests/auto/qlocale/tst_qlocale.cpp +++ b/tests/auto/qlocale/tst_qlocale.cpp @@ -1132,10 +1132,7 @@ void tst_QLocale::macDefaultLocale() QCOMPARE(locale.decimalPoint(), QChar('.')); QCOMPARE(locale.groupSeparator(), QChar(',')); QCOMPARE(locale.dateFormat(QLocale::ShortFormat), QString("M/d/yy")); - if (QSysInfo::MacintoshVersion > QSysInfo::MV_10_6) - QCOMPARE(locale.dateFormat(QLocale::LongFormat), QString("MMMM d, y")); - else - QCOMPARE(locale.dateFormat(QLocale::LongFormat), QString("MMMM d, yyyy")); + QCOMPARE(locale.dateFormat(QLocale::LongFormat), QString("MMMM d, yyyy")); QCOMPARE(locale.timeFormat(QLocale::ShortFormat), QString("h:mm AP")); QCOMPARE(locale.timeFormat(QLocale::LongFormat), QString("h:mm:ss AP t")); -- cgit v1.2.3