summaryrefslogtreecommitdiffstats
path: root/util
Commit message (Collapse)AuthorAgeFilesLines
* Add data for Windows Time-Zone IDs added in the last two yearsEdward Welbourne2019-07-011-0/+29
| | | | | | | | | | | | | | | | | | | We've not run util/locale_database/cldr2qtimezone.py for a while, so CLDR has had time to add several more zones. Catch up, inserting the new entries in order. Change-Id: I8625548b0f7775958230eccbd89b897d7afed9e9 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Tidy up in cldr2qtimezone.py and document the need to run itEdward Welbourne2019-07-012-12/+11
| | | | | | | | | | | | | | | | | | | It wasn't mentioned in cldr2qlocalexml.py's instructions, so I didn't know to run it. The data it used in an illustration was out of date. Two tests could be combined with no loss. Change-Id: I26e619e6210ea5b1258326fc4bc2b6aee9d6a999 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* cldr2qtimezone.py: report all missing zones, rather than just the firstEdward Welbourne2019-07-011-1/+6
| | | | | | | | | | | | | | | | | | | | | When scanning the CLDR data, the script raised an exception if it didn't recognize a zone ID. Instead, collect up such unrecognized IDs in a list and report them all at the end, so that whoever runs this can do them all in one go, rather than doing one, running the script, doing the next, running the script, ad nauseam. Change-Id: Ia659f1d1c7e1c1b4ccb87cc23828a0588a5bf958 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Use simpler data structures in cldr2qtimezone.pyEdward Welbourne2019-07-011-169/+165
| | | | | | | | | | | | | | | | | | | | | | Use tuples for the fixed data. The numbering of rows in the data tables isn't part of any public API, so we can change it freely; it is thus unnecessary, as we can just enumerate a tuple of the data values to generate sequential indices on the fly. (Updates to the data shall no longer need to renumber in order to insert entries.) Restore ordering of the data tables, and remove wanton spacing from inside parens, in the process. Change-Id: I59956cfb6191fe729300b57070671b7e66bd0379 Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Remove usages of deprecated APIs from QtAlgorithmsSona Kurazyan2019-06-296-10/+10
| | | | | | | | | | | | | | | | | Task-number: QTBUG-76491 Change-Id: I9dab736a0cbd2e86588919640c26e8ce6b3674d0 Reviewed-by: Alex Blasche <alexander.blasche@qt.io> Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
* gen_qfloat16_tables: add a comment explaining what the tool isThiago Macieira2019-06-031-1/+13
| | | | | | | | For our future selves. Change-Id: I2b1955a995ad40f3b89afffd15a4c127686662bc Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* qfloat16: Check in the tables to GitThiago Macieira2019-06-032-0/+153
| | | | | | | | | | | | | | | | | It's a 38k source file, which makes it MUCH smaller than other generated files like qlocale_data_p.h (982k) and qunicodetables.cpp (718k). The constants are platform-independent, since they are defined by IEEE 754, so they will never change. The generator tool is moved to util/ and removed from the build. That's one fewer bootstrapped tool to have to worry about. The output file is committed as .cpp so it won't get installed. Fixes: QTBUG-76165 Change-Id: I2b1955a995ad40f3b89afffd15a3ded58dc3e35f Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Separate out the time, zone, date code from corelib/tools/Edward Welbourne2019-06-061-2/+2
| | | | | | | | | | We'll be adding calendar code here as well, and tools/ was getting rather crowded, so it looks like time to move out a reasonably coherent sub-bundle of it all. Change-Id: I7e8030f38c31aa307f519dd918a43fc44baa6aa1 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Add locale support for Cebuano and Erzya languages (new in CLDR v35.1)Edward Welbourne2019-05-201-0/+2
| | | | | | | Change-Id: I5d0ee7bc27eeca1c046d442b0410128ea5abbdb3 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
* Suggest name, when available, for unknown codesEdward Welbourne2019-05-202-5/+57
| | | | | | | | | | | | | | | | When parsing the CLDR data, we only handle language, script and territory (which we call country) codes if they are known to our enumdata.py tables. When reporting the rest as unknown, in the content of an actual locale definition (not the likely subtag data), check whether en.xml can resolve the code for us; if it can, report the full name it provides, as a hint to whoever's running the script that an update to enumdata.py may be in order. Change-Id: I9ca1d6922a91d45bc436f4b622e5557261897d7f Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
* Rename util/locale_database/ to include the e that was missingEdward Welbourne2019-05-2016-3/+7
| | | | | | | | | It was misnamed local_database, quite missing the point of its name. Change-Id: I73a4fdf24f53daac12304de1f443636d89afacb2 Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
* Clean up some poorly-placed newlines in the TLD suffix dataEdward Welbourne2019-03-081-6/+6
| | | | | | | A comma appeared on a line on its own; a closing-brace didn't. Change-Id: I33cf37bb3574cd421c8af5ab6312865b71ce61f1 Reviewed-by: Peter Hartmann <peter-qt@hartmann.tk>
* Merge remote-tracking branch 'origin/5.13' into devLiang Qi2019-05-132-13/+37
|\ | | | | | | | | | | | | Conflicts: src/corelib/tools/qstring.cpp Change-Id: I81dbf90fc936c9bf08197baefa071117bddb1c63
| * Merge remote-tracking branch 'origin/5.12' into 5.13Qt Forward Merge Bot2019-05-092-13/+37
| |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/tools/qlocale_data_p.h (Regenerated by running the scripts in util/local_database/) src/gui/opengl/qopengltextureuploader.cpp Done-With: Edward Welbourne <edward.welbourne@qt.io> Done-With: Allan Sandfeld Jensen <allan.jensen@qt.io> Change-Id: I12df7f066ed0a25eb109f61c4b8d8dea63b683e2
| | * Update cldr2qlocalexml.py's claimed CLDR version supportEdward Welbourne2019-05-071-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | It was up to date with v34 (and seems to cope with v35.1) but only clained support for v29. Change-Id: I686cae1977824a4deec4633f19604b91061fe78a Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
| | * Correct and expand support for CLDR's date/time format stringsEdward Welbourne2019-05-071-12/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Our conversion from CLDR's format to our own was missing some things it could support sensibly, and some it could do better than ignore or treat as literal, while mis-handling the 'E'-based formats for day names. At least in CLDR v34 this doesn't actually make any difference (on regenerating our locale data, the only change is the date of generation). Task-number: QTBUG-70516 Change-Id: I9d27b9bf24afd168c2f8a5258143d3d695bca0ad Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
* | | Merge remote-tracking branch 'origin/5.13' into devLiang Qi2019-04-241-7/+7
|\| | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/gui/util/qshaderformat.cpp src/gui/util/qshaderformat_p.h src/widgets/graphicsview/qgraphicsitem_p.h Change-Id: Idafd88eb9a0a15b4af29f6143d009c1ec8ceecca
| * | Clean up help message for the public suffix list processorEdward Welbourne2019-04-231-7/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The grep given in the help from the program to process the effective-TLD list only worked for voodoo reasons. Replaced it with an actually-correct use of grep. The commands given used the name effective_tld_names.dat in the URL fetched; however, the relevant file has (for some time now) said explicitly "Please pull this list from, and only from https://publicsuffix.org/list/public_suffix_list.dat" Changed the name used to match that URL. Revised the output file's suggested name and the instructions for what to do with its contents, making clear they *replace* what was there before ... Fixed some typos and related ugliness. Change-Id: Iacd186c0003227d657099716262eb3a89c9e5f1b Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* | | Replace Q_DECL_NOTHROW with noexcept the remaining placesAllan Sandfeld Jensen2019-04-091-18/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The first replacement had missed objective-C++ code some places ourside the src dir. In C-files Q_DECL_NOTHROW is replaced with Q_DECL_NOEXCEPT as we still need to turn it off when compiled in C mode, but can get rid of the old NOTHROW moniker. Change-Id: I6370f57066679c5120d0265a69e7e378e09d4759 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | Merge remote-tracking branch 'origin/5.13' into devFriedemann Kleint2019-03-261-8/+6
|\| | | | | | | | | | | Change-Id: I38389a69411f4549fed432f1181dbe23398b34a2
| * | Merge remote-tracking branch 'origin/5.12' into 5.13Qt Forward Merge Bot2019-03-201-8/+6
| |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/gui/kernel/qplatformintegration.cpp src/gui/kernel/qplatformintegration.h src/plugins/platforms/wasm/qwasmintegration.cpp src/plugins/platforms/xcb/qxcbconnection_screens.cpp Change-Id: I15063d42e9a1e226d9d2d2d372f75141b84c5c1b
| | * Remove broken code from unicode generatorEskil Abrahamsen Blomfeldt2019-03-181-8/+0
| | | | | | | | | | | | | | | | | | | | | The current state produces uncompilable code. Change-Id: I9a68b61866a4a416335ed4d7204c58122803fb1c Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
| | * Wasm: Add workaround for Emscripten compiler againEskil Abrahamsen Blomfeldt2019-03-181-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This work around was added directly to the generated files at some point, and never to the generator it seems. So to avoid removing the workaround again when we regenerate the next time, we need to add it. Task-number: QTBUG-74511 Change-Id: Ided1bd949234ba82df61c55891646823e7f72e80 Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* | | Clean up and document the generator for qurltld_p.hEdward Welbourne2019-03-191-67/+96
|/ / | | | | | | | | | | | | | | | | This scans the public suffix list and emits suitable content for the header. Made some modest efficiency gains while hopefully making the code easier to understand. Check for success when opening files. Change-Id: If6b25c5c85f86209b33d9188743e820690e7dc05 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* | Adjust chunk-size in TLD-suffix list to placate MSVC 2015Edward Welbourne2019-03-011-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | MSVC 2015 has a size limit on strings; sizeof (including the terminating '\0') must not exceed 0xffff. The generator for the suffix-list data worked round this by breaking its data into chunks of at most 0xffff bytes; however, it was limiting on the strlen, not the sizeof, so was off by one. It checked for this before adding each suffix, so has (until now) always happened to break early enough; but the latest update gave an exactly 0xffff chunk, whose terminating '\0' took it over MSVC's limit. So adjust the cutoff to effectively include the terminating '\0'. Task-number: QTBUG-72623 Change-Id: I76ea40060d9fc13c0f7002c5ba22e71b8d0af787 Reviewed-by: Peter Hartmann <peter-qt@hartmann.tk>
* | Fix can not -> cannotRobert Loehning2019-02-251-1/+1
| | | | | | | | | | Change-Id: Ie9992f67ca59aff662a4be046ace08640e7c2714 Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* | Merge remote-tracking branch 'origin/5.12' into 5.13Qt Forward Merge Bot2019-02-192-4/+2
|\| | | | | | | Change-Id: Ifa143cc462301aaa305c9c85360e543553a751f0
| * Add cmdline feature to qmakeJoerg Bornemann2019-02-182-4/+2
| | | | | | | | | | | | | | | | | | [ChangeLog][qmake] A new feature "cmdline" was added that implies "CONFIG += console" and "CONFIG -= app_bundle". Task-number: QTBUG-27079 Change-Id: I6e52b07c9341c904bb1424fc717057432f9360e1 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
* | Merge remote-tracking branch 'origin/5.12' into devQt Forward Merge Bot2018-11-132-7/+35
|\| | | | | | | Change-Id: I5dbdc13c6133e5b03e362c5461b4a599d781bd1e
| * Clean up and update Unicode character data 3rd-party infrastructureEdward Welbourne2018-11-112-7/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Document how to do an update, fix the bit-rot that had crept into main.cpp since last it was compiled, correct the qt_attribution.json to use the actual version number of UCD (its Revision number) instead of the (admittedly correlated) Unicode release number. Updated to Release 22 (which came with Unicode 11.0.0) in the process; but this doesn't change our actual qunicodetables.cpp (so is incidental). Task-number: QTBUG-71281 Change-Id: Ieb7a6e1a4d49f639993f76ff82c8f12a572db3c3 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | Make util/lexgen/ mention itself in its auto-gen lineEdward Welbourne2018-11-014-10/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | In the process, update the README's e-mail address for Simon and mention all recognized command-line options in the usage message. The generated CSS scanner was also out of sync with our source, so update it. Also fixed handling of FileHeader to cope with running from a shadow build by handling paths relative to __FILE__; and revised the CSS3 config to use the same copyright header as was already in use by the existing generated file. Change-Id: I918ff84dbdc95d0478fd6aa4ea74e9a221d1a476 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | Correct and expand documentation of splitLocale()Edward Welbourne2018-09-101-2/+4
| | | | | | | | | | | | | | | | | | This amends c1141ed729b84f2c413975d37c1a91fb235fb14a; I failed to update the doc-string after some design changes part-way through developing the function. Change-Id: Ifb83107153d1c3b5a9dbd0536a3d6ee1fe32922d Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@qt.io>
* | Merge remote-tracking branch 'origin/5.12' into devQt Forward Merge Bot2018-09-021-0/+8
|\| | | | | | | Change-Id: I33e0abc771a2a772d3334172d50e7b0efe896590
| * WebAssembly for QtBaseMorten Johan Sørvig2018-08-301-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | This is the squashed diff from wip/webassembly to dev. Done-with: Peng Wu <peng.wu@intopalo.com> Done-with: Sami Enne <sami.enne@intopalo.com> Done-with: Morten Johan Sørvig <morten.sorvig@qt.io> Started-by: Andrew Knight <andrew.knight@intopalo.com> Change-Id: I6562433c0a38d6ec49ab675e0f104f2665f3392d Reviewed-by: Lorn Potter <lorn.potter@gmail.com> Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* | Right-align keys in enumdata.py's *_list mappingsEdward Welbourne2018-08-271-769/+769
| | | | | | | | | | | | Change-Id: Ia73745b4ce4da369dd8ad4edbc75f5534591480c Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com> Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@qt.io>
* | Reduce redundancy in CLDR script output to stderrEdward Welbourne2018-08-271-12/+26
| | | | | | | | | | | | | | | | A few patterns accounted for a substantial majority of the output, so report these in summarised (and somewhat tidly formatted) form. Change-Id: I57f8e41d5e68774fe57b01bb295534aa84a2df15 Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@qt.io>
* | Add some missing language codes to our locale dataEdward Welbourne2018-08-271-3/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | We were missing a few languages CLDR knew about; so add them to the list in enumdata.py (and add trailing commas to lists to make future additions not need to change the prior last line; python is perfectly happy with this). [ChangeLog][QtCore][QLocale] Added support for Western Balochi, Ido, Lojban, Sicilian and Souther Kurdish. Change-Id: I0d24cff46a0ae8db48ec1db8762088f877319982 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@qt.io>
* | Skip a few unused assignmentsEdward Welbourne2018-08-231-4/+0
| | | | | | | | | | Change-Id: Ia631627fb2e4e7eacf912a08d168e7b0a5700db7 Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@qt.io>
* | Fix handling of default content locale dataEdward Welbourne2018-08-221-36/+61
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We iterate theoretically many sources (albeit there's only really ever one) for this data, so accumulate instead of only keeping the last (and initialize it as the list it always ended up being, not a dictionary, so that this can work). The form of each token is a locale name, so it may be lang_Script just as readily as lang_LAND; so parse (and validate) the tags more faithfully to catch both cases. Abstract that parsing into a function and use it in both places that need it. Change-Id: Ibdbc4eafefab6a5ef70646d9fea150f2cb408d05 Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@qt.io>
* | Stipulate which error is expected in try/exceptEdward Welbourne2018-08-221-1/+1
|/ | | | | | | | PEP 8 wisely advises against the use of naked except: (unless re-raising the error). Change-Id: Ia0dfdb48b330d33ad370bdb9f6b205046aa919da Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@qt.io>
* Update QLocale::Country doc for new territoriesEdward Welbourne2018-08-161-1/+6
| | | | | | | | | Neglected in 44b6757fe50b6bf581864d3da519a3ff60818fa8 Noted the need for this in a relevant script's instructions. Change-Id: If69666f1799acebd434034c80b91056cb8777488 Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Tidy up generation of aliases in locale-related enumsEdward Welbourne2018-08-162-46/+70
| | | | | | | | | Replace lines of formatted output with dictionaries from which that output can be generated efficiently (in sorted order). Tidy up the python code, in the process. Change-Id: Ifb74eb69342646c5dbabc3247b3a8ddef602e934 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Normalise spacing in Language, Country and Script namesEdward Welbourne2018-08-161-764/+764
| | | | | | | | | | The scripts that generate the C++ enum names clean out spaces, so there's no need for enumdata.py to use the squished names; instead, include spaces where they belong and use them in the relevant names where they show up. Change-Id: I7261c87d69e654bc2e89f44d7ebbc06bfb403c58 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Add support for numbered territories in CLDREdward Welbourne2018-08-132-3/+7
| | | | | | | | | | | | | | | | | | The CLDR data contains eight locales with numeric territory codes, 001 for World, 150 for Europe and 419 for Latin America. The last was already known in our enumdata.py, but as "Latin America and The Caribbean", which is not supported by the CLDR, so I've amended it while adding the other two. This gives us support for Esperanto and Yiddish (among others). [ChangeLog][QtCore][QLocale] Added support for World and Europe as (numeric) "country" codes ("territory" in CLDR terms), thereby enabling support for Yiddish and Esperanto, among other locales using such codes. Task-number: QTBUG-57802 Change-Id: Ibb1180fb720743a3a0589527649d10f3c9cd123d Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Minor grammar fixupFrederik Gladhorn2018-08-031-1/+1
| | | | | | Change-Id: I528a2b2d8e9734bf5c00948a78369f4e89af16fc Reviewed-by: Paul Wicking <paul.wicking@qt.io> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Fix EDID vendor table generation script: source git repo is goneFrederik Gladhorn2018-08-031-1/+4
| | | | | | | | | fedorahosted seems to be gone and I didn't find a better source for the data. Change-Id: Ifb02b9833a735bab4aff2dc7a6db46aedd567583 Reviewed-by: Pier Luigi Fiorini <pierluigi.fiorini@liri.io> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Keep EDID pnp IDs sortedFrederik Gladhorn2018-08-031-1/+1
| | | | | | | | | In Python 3.6 the sorting comes for free, since dict keeps the insertion order, but adding sorted means older Python versions behave the same. Change-Id: I3ac4c0f5c3739cb8b284c8a02c4a96b5f41b2286 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Pier Luigi Fiorini <pierluigi.fiorini@liri.io>
* Rework CLDR parser to filter out unsupportable number systemsEdward Welbourne2018-07-161-14/+25
| | | | | | | | | | In the process, also have it only scan number systems once, caching the result, rather than scanning all of them for each locale. This means we only see the new warning messages once, too. Task-number: QTBUG-69324 Change-Id: Ia0695a0ba6159b50748a61e9949ad5bd07e4c4c3 Reviewed-by: Kai Koehne <kai.koehne@qt.io>
* SIMD: Change the way we declare constants for x86Thiago Macieira2018-07-091-15/+11
| | | | | | | | We need to use macros because MSVC is a crappy C compiler. Change-Id: Ieb48f7c0dd0e4e0fb35efffd153b8af62d34ebdf Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Fix wrongly included radial gradient enum for QGradient presetsTor Arne Vestbø2018-06-281-3/+6
| | | | | Change-Id: If8372224d7e113c1f55468c0de69dcab9804138f Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>