From c50b20a484620f394eab4c0cafaadabbd0f716d2 Mon Sep 17 00:00:00 2001 From: Edward Welbourne Date: Thu, 10 Nov 2022 18:49:43 +0100 Subject: [PATCH] Shuffle QTimeZone so backend-dependent parts are contiguous Coming work shall limit the feature to controlling these parts of the class, while making the rest visible to all builds. Change-Id: I602c604c8c66bd4f1816a9dabef19c72527831a5 Reviewed-by: Thiago Macieira --- src/corelib/time/qtimezone.h | 45 ++++++++++++++++++------------------ 1 file changed, 23 insertions(+), 22 deletions(-) diff --git a/src/corelib/time/qtimezone.h b/src/corelib/time/qtimezone.h index 677fb4afb24..796d838a5c0 100644 --- a/src/corelib/time/qtimezone.h +++ b/src/corelib/time/qtimezone.h @@ -33,6 +33,28 @@ public: MaxUtcOffsetSecs = +14 * 3600 }; + QTimeZone() noexcept; + explicit QTimeZone(int offsetSeconds); + + explicit QTimeZone(const QByteArray &ianaId); + QTimeZone(const QByteArray &zoneId, int offsetSeconds, const QString &name, + const QString &abbreviation, QLocale::Territory territory = QLocale::AnyTerritory, + const QString &comment = QString()); + QTimeZone(const QTimeZone &other) noexcept; + QTimeZone(QTimeZone &&other) noexcept; + ~QTimeZone(); + + QTimeZone &operator=(const QTimeZone &other); + QT_MOVE_ASSIGNMENT_OPERATOR_IMPL_VIA_PURE_SWAP(QTimeZone) + + void swap(QTimeZone &other) noexcept + { d.swap(other.d); } + + bool operator==(const QTimeZone &other) const; + bool operator!=(const QTimeZone &other) const; + + bool isValid() const; + enum TimeType { StandardTime = 0, DaylightTime = 1, @@ -55,27 +77,6 @@ public: }; typedef QList OffsetDataList; - QTimeZone() noexcept; - explicit QTimeZone(const QByteArray &ianaId); - explicit QTimeZone(int offsetSeconds); - QTimeZone(const QByteArray &zoneId, int offsetSeconds, const QString &name, - const QString &abbreviation, QLocale::Territory territory = QLocale::AnyTerritory, - const QString &comment = QString()); - QTimeZone(const QTimeZone &other) noexcept; - QTimeZone(QTimeZone &&other) noexcept; - ~QTimeZone(); - - QTimeZone &operator=(const QTimeZone &other); - QT_MOVE_ASSIGNMENT_OPERATOR_IMPL_VIA_PURE_SWAP(QTimeZone) - - void swap(QTimeZone &other) noexcept - { d.swap(other.d); } - - bool operator==(const QTimeZone &other) const; - bool operator!=(const QTimeZone &other) const; - - bool isValid() const; - QByteArray id() const; QLocale::Territory territory() const; #if QT_DEPRECATED_SINCE(6, 6) @@ -143,10 +144,10 @@ public: #endif private: - QTimeZone(QTimeZonePrivate &dd); #ifndef QT_NO_DATASTREAM friend Q_CORE_EXPORT QDataStream &operator<<(QDataStream &ds, const QTimeZone &tz); #endif + QTimeZone(QTimeZonePrivate &dd); friend class QTimeZonePrivate; friend class QDateTime; friend class QDateTimePrivate;