From f8c6151de19afbfee47e0f1c554c90feba6bfabb Mon Sep 17 00:00:00 2001 From: Yuhang Zhao <2546789017@qq.com> Date: Wed, 12 Oct 2022 09:22:11 +0800 Subject: [PATCH] QOperatingSystemVersion: fix newly introduced Android versions MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When introducing new entries for QOperatingSystemVersion, We should follow the new pattern [1], not the old legacy one. Amends commit 14278bb2506c079c4e10724107bd36b7af49b09b [1] qtbase/3446313c7a5cd6005089866a7b20c9f28e132a0a Change-Id: Id3444a1fba1384f9b4a410b3878ad25639b69f3d Reviewed-by: Thiago Macieira Reviewed-by: MÃ¥rten Nordheim --- src/corelib/global/qoperatingsystemversion.cpp | 6 ------ src/corelib/global/qoperatingsystemversion.h | 10 ++++------ 2 files changed, 4 insertions(+), 12 deletions(-) diff --git a/src/corelib/global/qoperatingsystemversion.cpp b/src/corelib/global/qoperatingsystemversion.cpp index bb29a6b1a0..05bcf2cd56 100644 --- a/src/corelib/global/qoperatingsystemversion.cpp +++ b/src/corelib/global/qoperatingsystemversion.cpp @@ -665,24 +665,18 @@ const QOperatingSystemVersion QOperatingSystemVersion::Android11 = \brief a version corresponding to Android 12 (version 12.0, API level 31). \since 6.5 */ -const QOperatingSystemVersion QOperatingSystemVersion::Android12 = - QOperatingSystemVersion(QOperatingSystemVersion::Android, 12, 0); /*! \variable QOperatingSystemVersion::Android12L \brief a version corresponding to Android 12L (version 12.0, API level 32). \since 6.5 */ -const QOperatingSystemVersion QOperatingSystemVersion::Android12L = - QOperatingSystemVersion(QOperatingSystemVersion::Android, 12, 0); /*! \variable QOperatingSystemVersion::Android13 \brief a version corresponding to Android 13 (version 13.0, API level 33). \since 6.5 */ -const QOperatingSystemVersion QOperatingSystemVersion::Android13 = - QOperatingSystemVersion(QOperatingSystemVersion::Android, 13, 0); diff --git a/src/corelib/global/qoperatingsystemversion.h b/src/corelib/global/qoperatingsystemversion.h index d6fee2980c..5277333fdf 100644 --- a/src/corelib/global/qoperatingsystemversion.h +++ b/src/corelib/global/qoperatingsystemversion.h @@ -152,9 +152,6 @@ public: static const QOperatingSystemVersion AndroidPie; static const QOperatingSystemVersion Android10; static const QOperatingSystemVersion Android11; - static const QOperatingSystemVersion Android12; - static const QOperatingSystemVersion Android12L; - static const QOperatingSystemVersion Android13; #else static constexpr QOperatingSystemVersionBase Windows7 { QOperatingSystemVersionBase::Windows, 6, 1 }; static constexpr QOperatingSystemVersionBase Windows8 { QOperatingSystemVersionBase::Windows, 6, 2 }; @@ -189,9 +186,6 @@ public: static constexpr QOperatingSystemVersionBase AndroidPie { QOperatingSystemVersionBase::Android, 9, 0 }; static constexpr QOperatingSystemVersionBase Android10 { QOperatingSystemVersionBase::Android, 10, 0 }; static constexpr QOperatingSystemVersionBase Android11 { QOperatingSystemVersionBase::Android, 11, 0 }; - static constexpr QOperatingSystemVersionBase Android12 { QOperatingSystemVersionBase::Android, 12, 0 }; - static constexpr QOperatingSystemVersionBase Android12L { QOperatingSystemVersionBase::Android, 12, 0 }; - static constexpr QOperatingSystemVersionBase Android13 { QOperatingSystemVersionBase::Android, 13, 0 }; #endif // New (static constexpr) entries go here, only cherry-pick as far back as 6.3 (QTBUG-97808): static constexpr QOperatingSystemVersionBase Windows10_1809 { QOperatingSystemVersionBase::Windows, 10, 0, 17763 }; // RS5 @@ -205,6 +199,10 @@ public: static constexpr QOperatingSystemVersionBase Windows11_21H2 = Windows11; static constexpr QOperatingSystemVersionBase Windows11_22H2 { QOperatingSystemVersionBase::Windows, 10, 0, 22621 }; + static constexpr QOperatingSystemVersionBase Android12 { QOperatingSystemVersionBase::Android, 12, 0 }; + static constexpr QOperatingSystemVersionBase Android12L { QOperatingSystemVersionBase::Android, 12, 0 }; + static constexpr QOperatingSystemVersionBase Android13 { QOperatingSystemVersionBase::Android, 13, 0 }; + constexpr QOperatingSystemVersion(const QOperatingSystemVersionBase &osversion) : QOperatingSystemVersionBase(osversion) {}