From 2196d3eff7bfd47f4eece3546d100f1b163dbd37 Mon Sep 17 00:00:00 2001 From: Edward Welbourne Date: Fri, 27 Oct 2023 18:52:26 +0200 Subject: [PATCH] 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 Reviewed-by: Thiago Macieira (cherry picked from commit 4e3518bf633119dd83aaed05ec9e31e6fcf13dff) Reviewed-by: Qt Cherry-pick Bot --- src/corelib/time/qtimezone.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/corelib/time/qtimezone.cpp b/src/corelib/time/qtimezone.cpp index 44b6662b5b7..2abf14c0458 100644 --- a/src/corelib/time/qtimezone.cpp +++ b/src/corelib/time/qtimezone.cpp @@ -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)) { }