Scan CLDR for {,kilo,mega,giga,tera,peta,exa}byte forms and their IEC
equivalents, providing SI and IEC defaults when missing (which all of
IEC are) in addition to the usual numeric data. Extrapolate from any
present data (e.g. French's ko, Mo, Go, To imply Po, Eo and, for IEC,
Kio, Mio, etc.), since CLDR only goes up to tera. Propagate this data
to QLocale's database ready for use by QLocale::formattedDataSize().
Change-Id: Ie6ee978948c68be9f71ab784a128cbfae3d80ee1
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Use python more fluently; DRY - use functions to avoid repetition; use
dict-comprehensions; use os.path.join() in preference to arithmetic
with path strings; use elsif to avoid the need for a local variable;
set() can take a generator directly, no need to go via a list; don't
end lines in semicolon (this is python). Test isdir() once instead of
exists() twice on the same name.
Just, generally, use python's feature-set.
Change-Id: Ib114aa016f70b3be09e968d9cfc069b057f49d41
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
load{Language,Script,Country}Map() were all structurally very similar,
so replace them with a single loadMap() that takes a second argument
to say *which* map to load. At the same time, use a dict
comprehension to simplify constructing the result.
Change-Id: Ie43a71156010277200543a8937056efd35251955
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
This simplifies a duplicated iteration pattern in the calling code.
It also frees the first-node function to raise an Error (which the
iterator now catches) if it finds no node, where it used to return
False (instead of a node, so other code using it would raise confusing
errors from trying to use False as a node, where now it'll get a clear
Error about a missing node). There were also no callers passing an
empty name, so the test for matching nodes (here moved to its own
short function) didn't need to handle that as a special case.
Change-Id: Ife6cad8943cf5dc2c6ed68429d4a217cb9bea446
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
It had a separate variable for each of three lists for each day of the
week; and used each list only once. Iterate the days of the week for
each lookup, discarding it once used.
Change-Id: I32c8bd5bfcbb99f0a8697d374e63112761f18dbb
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Each StringData object got its own block, of common form, to output
its C array; give each object a name so that we can automate this as
an iteration over StringData objects. One (endonyms_data) gains a
blank line that the others all had but it lacked.
Change-Id: I96c014728a58343c82304c5117b474fee980d9c7
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
... because copy-and-paste is worth discouraging. Moved code that
writes and digests our Q Local XML form of the data into a common
class, localexml.Locale, for use by the scripts that write and read
it. Hopefully, it'll be easier to keep what's written and read in
sync hereafter.
Inlined some trivial functions in the process; and only create a
day-number mapping dictionary once, instead of once per use. Also
made it easier to see which attributes get which special handling (and
documented this); and revised an assertion to be more helpful.
Change-Id: I711b6a193a4ad94b5ff714c025f2732cd1a965a7
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Include headers for all fields (several were missing).
Make field widths explicit to headers can line up with content.
Use the same format for the (common part of the) all-zeros line.
Document and lay-out headers and format string, to make them easier to
keep in sync. Make a pair of comments clearer.
Re-ran the script to regenerate the table: the result is best viewed
with git show -w, to ignore the spacing changes (or git show -b to
notice only the one harmless discrepancy exposed in old all-zeros
data). Aside from spacing, locale_data[] has gained some missing
columns in its header comment, which now lines headings up properly
above actual data.
Change-Id: I44242f38391353f2ec8e144cb7e8b54b0a359341
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Say where to find the scripts and make clear what to update to get
changes.
Change-Id: I424b7fdf846f7141c6df81eef90eb1ca0378bcf8
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Make the python2 dependency explicit (sooner or later, python3 shall
be the default /bin/env python), make time-zone script executable (it
had a shebang). Use triple-quoted strings, or single quotes, to avoid
extra backslashes, remove some simply spurious backslashes. Use
generators rather than map or filter with lambdas and iterate rather
than duplicating code. Clarify some comments.
Regenerated headers: this upates the date of generation, cuts back a
double-blank-line to single and skips a spurious trailing
comma-newline on an array's data.
Change-Id: I54439f0dec132865991fe5147d509cea0f9419a0
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
We were using "Han With Bopomofo" (capitalized With) so that an enum
member in qlocale.h would be suitably camel-case; however, this lead
to spurious changes in qlocale_data_p.h where it names the script.
Use the correct (lower-case with) form and arrange for the enum
members to be generated with first letter of each word upper-case (but
not with each word capitalize()d; some words in there are already
camel-case, so .capitalize()ing would lower-case the later sub-words
in these).
Change-Id: I974c89dd40814eaf3bd538f06b9b4ebf17492f20
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Say where to find the data, how to unpack it and how to run the
scripts to update our source tree from it.
Change-Id: I5b680090bb5850f29c1e7d61efd1d450856b9949
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Compilation and link times in CPU seconds with GCC 7, using precompiled
headers (not including moc, rcc, uic, etc. steps or headersclean):
Before After
Debug -O0 198,1 180,3
Debug -Og 240,7 229,2
Release -O3 267,1 249,2
Release LTO 239,4 229,8
QtCore required a little manual adjusting because some files are
bootstrapped into moc itself and into qmake.
Change-Id: I84e363d735b443cb9beefffd14b8b57c10e7da36
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Add a support library to parse EDID that will be used by platform
plugins.
In order to tell the screen manufacturer from the identifier, the
parsers reads /usr/share/hwdata/pnp.ids or, if it's missing, uses
a lookup table previously generated from that file with a Python script.
Change-Id: Ie021eb68be91f06dc0da54445f88e3533f78d23e
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
Adds parsing and handling of the indirect sibling selector, this should
mean we can at least parse all CSS3 selectors even if we do not yet
support all of them.
Also adds tests for previously added CSS3 selectors.
Change-Id: I1ce9afb9466044a38bdec167affc21a87837e4a4
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Adds the three CSS3 attribute selectors.
During this the internal naming of the existing attribute-selectors have
been changed to be more clear, and the dash-matching has been fixed to
not just be beginsWith.
A non-breaking space have also been removed from the CSS.
Change-Id: Ia4db4a5a19e3ceee8c3c8a4b744149edd1d32bdc
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* A bunch of fixes and additions to the locale data
* Add new scripts from Unicode 8.0 and 9.0
* Map some potentially useful languages and territories
[ChangeLog][QtCore] QLocale data updated to CLDR v29
Change-Id: I759ccb27fe19be2722be913c5c2e6aa5f36e5c14
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
Update files using old header.LGPL3 to header.LGPL
Update files using old FDL template to use new one
Update files using old BSD template to use new one
Change-Id: I36a78272516f9953d02956522f285b40adfc8915
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
For QLatin1String, operator== is overloaded, so comparing to a latin-1
(C) string literal is efficient, since strlen() is comparatively fast.
OTOH, QStringLiteral, when not using RVO, litters the code with
QString dtor calls, which are not inline. Worse, absent lambdas,
it even allocates memory.
So, just compare using QLatin1String instead.
Change-Id: I761b2b26ab5b416bc695f524a9ee607dacf0a7b2
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
From Qt 5.7 -> tools & applications are lisenced under GPL v3 with some
exceptions, see
http://blog.qt.io/blog/2016/01/13/new-agreement-with-the-kde-free-qt-foundation/
Updated license headers to use new GPL-EXCEPT header instead of LGPL21 one
(in those files which will be under GPL 3 with exceptions)
Change-Id: I42a473ddc97101492a60b9287d90979d9eb35ae1
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
and implement TitlecaseTraits as well,
to be re-used in the following commit.
Change-Id: I5c0bff42fe3b9bc9c2454cc16916cc2be87f604f
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
Use static_cast instead of C-style cast;
ushort -> unsigned short;
Avoid a lvalue in qGetProp();
Minor styling fixes.
Change-Id: Ic6412e28ac9316a587d32d0e674d21f672967fd6
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* Georgian lari currency symbol
* A large collection of CJK unified ideographs
* Emoji symbols and symbol modifiers
* Letters to support the Ik language in Uganda, Kulango in
the Côte d’Ivoire, and other languages of Africa
* A set of lowercase Cherokee syllables, forming case pairs
with the existing Cherokee characters
* The Ahom script for support of the Tai Ahom language in India
* Arabic letters to support Arwi—the Tamil language written in the Arabic script
For more details, see http://www.unicode.org/versions/Unicode8.0.0/
[ChangeLog][QtCore] Unicode data updated to v.8.0
Change-Id: If255f95c9c45655b721369a116299da3cabbba0a
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
An executable .sh file should have its #! be the first two bytes.
Change-Id: I22c9eee6d349df743b02996bef0e093df3f42eb5
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@theqtcompany.com>
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@theqtcompany.com>
[ChangeLog][QtCore] QTimeZone data updated to CLDR v.27
Change-Id: Ic25229d86ac4752ed70f5a729fd33c1a837241dc
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
They are in UTC-03:00, not in UTC+03:00 (just a C&P typo).
Change-Id: Ib342b65967404b8756c62953258b17421b9245af
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
+ A bunch of fixes in the locale data
+ New scripts from Unicode 7.0
+ New locales
- Some locales disappeared (aa_DJ, aa_ER, st_LS, ss_SZ, swc_CD, tn_BW)
- Some locales lost their contents (i.e. en_Dsrt_US)
[ChangeLog][QtCore] QLocale data updated to CLDR v.27
Change-Id: Iba8c7884f8087e577cbb25a8fc106dd7bd3ebb5d
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Two newly adopted currency symbols:
the Azerbaijan manat and the Russia ruble
* Pictographic symbols (including many emoji), geometric symbols,
arrows, and ornaments originating from the Wingdings and Webdings sets
* Twenty-three new lesser-used and historic scripts
extending support for written languages of North America, China, India,
other Asian countries, and Africa
* Letters used in Teuthonista and other transcriptional systems,
and a new notational set, Duployan
For more details, see http://www.unicode.org/versions/Unicode7.0.0/
The Properties struct's .*Diff members were narrowed down
to signed 15 bits and the unicodeVersion has been expanded to 8 bits.
[ChangeLog][QtCore] Unicode data updated to v.7.0
Change-Id: I93ab6f79fa3b05f61abc7279f1d046834c1c1a0b
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Locales with an explicit parent locale should not inherit
the language-default locale.
For example, a correct chain for zh_Hant_MO is:
zh_Hant_MO -> zh_Hant_HK -> zh_Hant -> root
(two fixups: zh_Hant_HK and root, so that do not inherit zh)
Fortunately, this didn't do any difference in a generated data.
Change-Id: I92e09a95bd86f8723d8fe993f57d99af6f50db5e
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Qt copyrights are now in The Qt Company, so we could update the source
code headers accordingly. In the same go we should also fix the links to
point to qt.io.
Outdated header.LGPL removed (use header.LGPL21 instead)
Old header.LGPL3 renamed to header.LGPL3-COMM to match actual licensing
combination. New header.LGPL-COMM taken in the use file which were
using old header.LGPL3 (src/plugins/platforms/android/extract.cpp)
Added new header.LGPL3 containing Commercial + LGPLv3 + GPLv2 license
combination
Change-Id: I6f49b819a8a20cc4f88b794a8f6726d975e8ffbe
Reviewed-by: Matti Paaso <matti.paaso@theqtcompany.com>
Yes, this is necessary. The noexcept operator looks for noexcept tagging,
not at the contents of the function to determine whether to return true.
The more conditionally-noexcept functions are used, the more important it
becomes that low-level functions are correctly marked noexcept. In that, it
is like constexpr.
Change-Id: I4bca178444d1fd7caf3a92f996b1536eebdb5014
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
The .spec file is no longer updated thus support for gl 4.4 is impossible without an update to parse the new xml spec. The legacy parser can be used with the -l (--legacy) switch.
Task-number: QTBUG-33671
Task-number: QTBUG-40090
Change-Id: I83d9380842a16e925f6c07331ee35fe035f6baa9
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
The GCC documentation says that a const function is not allowed to read
global memory. This needs to be clarified: it's not allowed to read RW
global memory. It's fine to read read-only memory, as that is equivalent
to just pure code.
The QChar static out-of-line functions only lookup a property of the
given Unicode character and always return the same value.
The only exception is the decomposition() function, which returns a
QString and is therefore not allowed to be marked const.
Change-Id: Id36b2f84a1b8ff9db5acf1d4e59e8b3811068cff
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>