Route QTimeZone::setSecondsAheadOfUtc() via setDurationAheadOfUtc()
... rather than the other way round. This ensures that the latter's check for value-in-range is correctly handled. Pick-to: 6.5 Task-number: QTBUG-109580 Change-Id: I21c2e7c1787c8f57e6893353e42261c013b648f6 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
This commit is contained in:
parent
bf6cc9a4e2
commit
ff7d5809f1
@ -121,13 +121,14 @@ public:
|
|||||||
|
|
||||||
static QTimeZone fromDurationAheadOfUtc(std::chrono::seconds offset)
|
static QTimeZone fromDurationAheadOfUtc(std::chrono::seconds offset)
|
||||||
{
|
{
|
||||||
return fromSecondsAheadOfUtc(int(offset.count()));
|
return QTimeZone((offset.count() >= MinUtcOffsetSecs && offset.count() <= MaxUtcOffsetSecs)
|
||||||
|
? ShortData(offset.count() ? Qt::OffsetFromUTC : Qt::UTC,
|
||||||
|
int(offset.count()))
|
||||||
|
: ShortData(Qt::TimeZone));
|
||||||
}
|
}
|
||||||
static QTimeZone fromSecondsAheadOfUtc(int offset)
|
static QTimeZone fromSecondsAheadOfUtc(int offset)
|
||||||
{
|
{
|
||||||
return QTimeZone((offset >= MinUtcOffsetSecs && offset <= MaxUtcOffsetSecs)
|
return fromDurationAheadOfUtc(std::chrono::seconds{offset});;
|
||||||
? ShortData(offset ? Qt::OffsetFromUTC : Qt::UTC, offset)
|
|
||||||
: ShortData(Qt::TimeZone));
|
|
||||||
}
|
}
|
||||||
constexpr Qt::TimeSpec timeSpec() const noexcept { return d.s.spec(); }
|
constexpr Qt::TimeSpec timeSpec() const noexcept { return d.s.spec(); }
|
||||||
constexpr int fixedSecondsAheadOfUtc() const noexcept
|
constexpr int fixedSecondsAheadOfUtc() const noexcept
|
||||||
|
Loading…
Reference in New Issue
Block a user