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/qdatetime.cpp | |
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/qdatetime.cpp')
0 files changed, 0 insertions, 0 deletions