diff options
author | Konstantin Ritt <ritt.ks@gmail.com> | 2012-11-14 18:09:02 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2012-11-15 13:55:00 +0100 |
commit | e4c2a5c29f78def39801d8f2ea12b954594f7e7d (patch) | |
tree | 78c3749c98ed937c3b3ddde0b67e2376ae6b0bdf /util/local_database/enumdata.py | |
parent | 1e0e5f2d68f58843d900467eea6981b5a28244f5 (diff) |
Assign correct codes to QLocale::AnyCountry and AnyScript
as their meaning, in fact, is unknown (or default) country/script.
Change-Id: Id75a70d4b33c2092de414f3ac357f6bcb627ba47
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Diffstat (limited to 'util/local_database/enumdata.py')
-rw-r--r-- | util/local_database/enumdata.py | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/util/local_database/enumdata.py b/util/local_database/enumdata.py index 326eaab287..1c92aec944 100644 --- a/util/local_database/enumdata.py +++ b/util/local_database/enumdata.py @@ -264,7 +264,7 @@ language_list = { } country_list = { - 0 : [ "AnyCountry", " " ], + 0 : [ "AnyCountry", "ZZ" ], 1 : [ "Afghanistan", "AF" ], 2 : [ "Albania", "AL" ], 3 : [ "Algeria", "DZ" ], @@ -514,7 +514,7 @@ country_list = { } script_list = { - 0 : [ "AnyScript", "" ], + 0 : [ "AnyScript", "Zzzz" ], 1 : [ "Arabic", "Arab" ], 2 : [ "Cyrillic", "Cyrl" ], 3 : [ "Deseret", "Dsrt" ], @@ -552,18 +552,24 @@ script_list = { } def countryCodeToId(code): + if not code: + return 0 for country_id in country_list: if country_list[country_id][1] == code: return country_id return -1 def languageCodeToId(code): + if not code: + return 0 for language_id in language_list: if language_list[language_id][1] == code: return language_id return -1 def scriptCodeToId(code): + if not code: + return 0 for script_id in script_list: if script_list[script_id][1] == code: return script_id |