diff options
author | Edward Welbourne <edward.welbourne@qt.io> | 2020-11-16 16:48:22 +0100 |
---|---|---|
committer | Edward Welbourne <edward.welbourne@qt.io> | 2021-02-18 11:21:19 +0100 |
commit | 755c678f0f5062cee4b8e71f6f2ff3958a01715e (patch) | |
tree | af0744765535e6bcebd5a925debcca09ee90f881 /src/corelib/time/qmilankoviccalendar_p.h | |
parent | 6fa9f487db1a1947815c9e4125688b9dc4df117f (diff) |
Provide calendar backends with a unique ID
Registration by ID allows for detection of duplicate instantiation of
built-in back-ends, which can be detected and flagged by setting the
ID to ~size_t(0) instead of the enum value for which it sought to be
registered. A new method, calendarId(), is provided to access this;
while the old calendarSystem() becomes non-virtual, as it can be
inferred (when registration was successful) from the ID.
Make registration by name or alias conditional on successful
registration by ID. Previously, failed registration by name precluded
registration by ID, which now becomes the authoritative registration.
This incidentally makes it possible to add a QCalendar constructor
taking the unique ID of a backend, for use in conjunction with custom
calendar implementations.
Change-Id: Ib22925a8ac3ef9439a09ec3855f6231cf9b91c21
Reviewed-by: MÃ¥rten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib/time/qmilankoviccalendar_p.h')
-rw-r--r-- | src/corelib/time/qmilankoviccalendar_p.h | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/src/corelib/time/qmilankoviccalendar_p.h b/src/corelib/time/qmilankoviccalendar_p.h index ebff7e7f39..8527aed627 100644 --- a/src/corelib/time/qmilankoviccalendar_p.h +++ b/src/corelib/time/qmilankoviccalendar_p.h @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2018 The Qt Company Ltd. +** Copyright (C) 2020 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the QtCore module of the Qt Toolkit. @@ -61,7 +61,6 @@ public: QMilankovicCalendar(); // Calendar properties: QString name() const override; - QCalendar::System calendarSystem() const override; // Date queries: bool isLeapYear(int year) const override; // Julian Day conversions: |