diff options
author | Qt Forward Merge Bot <qt_forward_merge_bot@qt-project.org> | 2019-12-04 01:00:23 +0100 |
---|---|---|
committer | Qt Forward Merge Bot <qt_forward_merge_bot@qt-project.org> | 2019-12-04 01:00:23 +0100 |
commit | 0c29ebe374caad7e29c6a3d35c72c4eddaacc6af (patch) | |
tree | c6b228302ab37375a82f7bfb535e5bb39d36e624 /src/corelib/time/qtimezoneprivate_mac.mm | |
parent | e5438e8ded27eb6f7f0e85704d6843069296c698 (diff) | |
parent | 2ed59f0d42d2817a5855be167f5e3ccf23563e39 (diff) |
Merge remote-tracking branch 'origin/5.15' into dev
Change-Id: I4134c0c6b6c9911950f58b3b5c86e789d28a185b
Diffstat (limited to 'src/corelib/time/qtimezoneprivate_mac.mm')
-rw-r--r-- | src/corelib/time/qtimezoneprivate_mac.mm | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/corelib/time/qtimezoneprivate_mac.mm b/src/corelib/time/qtimezoneprivate_mac.mm index d3c4fbe5da..4509e316f9 100644 --- a/src/corelib/time/qtimezoneprivate_mac.mm +++ b/src/corelib/time/qtimezoneprivate_mac.mm @@ -1,5 +1,6 @@ /**************************************************************************** ** +** Copyright (C) 2019 The Qt Company Ltd. ** Copyright (C) 2013 John Layt <jlayt@kde.org> ** Contact: https://www.qt.io/licensing/ ** @@ -94,6 +95,16 @@ void QMacTimeZonePrivate::init(const QByteArray &ianaId) if (m_nstz) m_id = ianaId; } + if (!m_nstz) { + // macOS has been seen returning a systemTimeZone which reports its name + // as Asia/Kolkata, which doesn't appear in knownTimeZoneNames (which + // calls the zone Asia/Calcutta). So explicitly check for the name + // systemTimeZoneId() returns, and use systemTimeZone if we get it: + m_nstz = [NSTimeZone.systemTimeZone retain]; + Q_ASSERT(m_nstz); + if (QString::fromNSString(m_nstz.name).toUtf8() == ianaId) + m_id = ianaId; + } } QString QMacTimeZonePrivate::comment() const |