diff options
author | John Layt <jlayt@kde.org> | 2013-02-19 11:33:16 +0000 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-09-22 22:21:24 +0200 |
commit | 8dfaf910388fc0dd3c53c382e9ff85dd78a9a3ef (patch) | |
tree | 47a52f8e4a853672eeaac86eafb1e310f163cc80 /src/corelib/tools/qtimezone.cpp | |
parent | 9c2cbee2b1adedf53fa86a1c7a86f561747ab962 (diff) |
QTimeZone - Add TZ File Backend
Add a backend for TZ Files.
If available uses ICU for the display names and translations, otherwise
the abbreviation is used.
Change-Id: I58c777462810b1a76ea7bd95886836b70b8a3db5
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib/tools/qtimezone.cpp')
-rw-r--r-- | src/corelib/tools/qtimezone.cpp | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/src/corelib/tools/qtimezone.cpp b/src/corelib/tools/qtimezone.cpp index 53fd3fb0bf..9de9e5de8b 100644 --- a/src/corelib/tools/qtimezone.cpp +++ b/src/corelib/tools/qtimezone.cpp @@ -52,21 +52,41 @@ QT_BEGIN_NAMESPACE // Create default time zone using appropriate backend static QTimeZonePrivate *newBackendTimeZone() { -#if defined QT_USE_ICU +#ifdef QT_NO_SYSTEMLOCALE +#ifdef QT_USE_ICU return new QIcuTimeZonePrivate(); #else return new QUtcTimeZonePrivate(); #endif // QT_USE_ICU +#else +#if defined Q_OS_UNIX && !defined Q_OS_MAC + return new QTzTimeZonePrivate(); +#elif defined QT_USE_ICU + return new QIcuTimeZonePrivate(); +#else + return new QUtcTimeZonePrivate(); +#endif // System Locales +#endif // QT_NO_SYSTEMLOCALE } // Create named time zone using appropriate backend static QTimeZonePrivate *newBackendTimeZone(const QByteArray &olsenId) { -#if defined QT_USE_ICU +#ifdef QT_NO_SYSTEMLOCALE +#ifdef QT_USE_ICU return new QIcuTimeZonePrivate(olsenId); #else return new QUtcTimeZonePrivate(olsenId); #endif // QT_USE_ICU +#else +#if defined Q_OS_UNIX && !defined Q_OS_MAC + return new QTzTimeZonePrivate(olsenId); +#elif defined QT_USE_ICU + return new QIcuTimeZonePrivate(olsenId); +#else + return new QUtcTimeZonePrivate(olsenId); +#endif // System Locales +#endif // QT_NO_SYSTEMLOCALE } class QTimeZoneSingleton |