diff options
| author | Edward Welbourne <edward.welbourne@qt.io> | 2024-11-29 17:01:15 +0100 |
|---|---|---|
| committer | Edward Welbourne <edward.welbourne@qt.io> | 2024-12-03 19:48:19 +0100 |
| commit | 54c2d6ded779c3b9843fa18535b79ababa0d1a74 (patch) | |
| tree | f41b84fe4759a3621cb841f8d4baaf97f0f47d43 /src/tools/uic/cpp/cppwriteinitialization.cpp | |
| parent | d9ad2251d9fff85a18ce5afc62bcb1230cd2820d (diff) | |
Fix TZ backend to include CLDR-known zones by territory
As previously noted, this backend uses the legacy zone.tab file, which
only gives one territory for each entry, where zone1970.tab gives
several. Until we switch to using the latter, we thus don't know all
the territories in which an IANA ID is used. However, we do have such
data from CLDR and deploy it in the default backend to filter the list
of all available IDs. As a result, the TZ backend lacks some results
of filtering by territory that the base-class would get for it,
because the CLDR data associates more territories with some IDs.
It implements the overload because its lookups in a hash are
potentially more efficient than generating its full list in order to
iterate it while intersecting with a CLDR-derived list of candidates.
Leverage that hash also to do efficient intersecting with the
CLDR-derived list, which lets us avoid duplicates almost for free, to
make the subsequent union with the directly-derived entries from
zone.tab efficient. This incidentally resolves a TODO about handling
of QLocale::AnyTerritory. In the process, add more notes to the
zone{1970,}.tab details.
Restructure the base-class implementations of filtered available IDs
to separate their generation of a CLDR-derived list of candidates from
the intersection of that with the available IDs. For the territory
overload, this lets the TZ backend share the CLDR-derived list; for
symmetry, do the same to the offset-filter, too. (This also makes each
function responsible for fewer things.) Similar treatment may also be
needed for the ICU and chrono::tzdb backends, since the former also
overloads the territory filter and both overload the offset filter.
However, leave those for now (with comments added on the possibility)
until we have evidence they actually do need this.
Pick-to: 6.8
Task-number: QTBUG-130877
Task-number: QTBUG-64941
Change-Id: Ibb347df88dd14b55f8f580bb4c9e37e5c56a533a
Reviewed-by: Mate Barany <mate.barany@qt.io>
Diffstat (limited to 'src/tools/uic/cpp/cppwriteinitialization.cpp')
0 files changed, 0 insertions, 0 deletions
