Align doc of custom QTimeZone constructor with declaration

The ID of the custom zone *must not* be an IANA ID, so naming the
variable ianaId was misleading. The declaration in qtimezone.h uses
zoneId, which is more appropriate, so change the docs and definition
to use that name instead. Also add emphasis where the doc says it must
not be an IANA ID.

Pick-to: 6.5
Change-Id: I55fbb748173b540741453db3f1e2492272635f9a
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 4e3518bf633119dd83aaed05ec9e31e6fcf13dff)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
Edward Welbourne 2023-10-27 18:52:26 +02:00 committed by Qt Cherry-pick Bot
parent ab34aa760c
commit 2196d3eff7

View File

@ -510,15 +510,15 @@ QTimeZone::QTimeZone(int offsetSeconds)
/*!
Creates a custom time zone instance at fixed offset from UTC.
The returned time zone has an ID of \a ianaId and an offset from UTC of \a
The returned time zone has an ID of \a zoneId 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 territory will be used
by territory(). The \a comment is an optional note that may be displayed in
a GUI to assist users in selecting a time zone.
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
The \a zoneId \e{must not} be one of the available system IDs returned by
availableTimeZoneIds(). The \a offsetSeconds from UTC must be in the range
-16 hours to +16 hours.
If the custom time zone does not have a specific territory then set it to the
@ -530,10 +530,10 @@ QTimeZone::QTimeZone(int offsetSeconds)
MinUtcOffsetSecs, MaxUtcOffsetSecs
*/
QTimeZone::QTimeZone(const QByteArray &ianaId, int offsetSeconds, const QString &name,
QTimeZone::QTimeZone(const QByteArray &zoneId, int offsetSeconds, const QString &name,
const QString &abbreviation, QLocale::Territory territory, const QString &comment)
: d(isTimeZoneIdAvailable(ianaId) ? nullptr // Don't let client code hijack a real zone name.
: new QUtcTimeZonePrivate(ianaId, offsetSeconds, name, abbreviation, territory, comment))
: d(isTimeZoneIdAvailable(zoneId) ? nullptr // Don't let client code hijack a real zone name.
: new QUtcTimeZonePrivate(zoneId, offsetSeconds, name, abbreviation, territory, comment))
{
}