Changeset View
Changeset View
Standalone View
Standalone View
src/address.cpp
Show First 20 Lines • Show All 666 Lines • ▼ Show 20 Line(s) | 665 | if (countryInfo[0] == cname) { | |||
---|---|---|---|---|---|
667 | sISOMap->insert(cname, countryInfo[1]); | 667 | sISOMap->insert(cname, countryInfo[1]); | ||
668 | return countryInfo[1]; | 668 | return countryInfo[1]; | ||
669 | } | 669 | } | ||
670 | strbuf = s.readLine(); | 670 | strbuf = s.readLine(); | ||
671 | } | 671 | } | ||
672 | file.close(); | 672 | file.close(); | ||
673 | } | 673 | } | ||
674 | 674 | | |||
675 | // fall back to system country | 675 | return {}; | ||
676 | QString systemCountry = QLocale().bcp47Name(); | | |||
677 | sISOMap->insert(cname, systemCountry); | | |||
678 | return systemCountry; | | |||
679 | } | 676 | } | ||
680 | 677 | | |||
681 | QString Address::ISOtoCountry(const QString &ISOname) | 678 | QString Address::ISOtoCountry(const QString &ISOname) | ||
682 | { | 679 | { | ||
683 | // get country name from ISO country code (e.g. "no" -> i18n("Norway")) | 680 | // get country name from ISO country code (e.g. "no" -> i18n("Norway")) | ||
684 | if (ISOname.simplified().isEmpty()) { | 681 | if (ISOname.simplified().isEmpty()) { | ||
685 | return QString(); | 682 | return QString(); | ||
686 | } | 683 | } | ||
▲ Show 20 Lines • Show All 42 Lines • Show Last 20 Lines |