Fix countryToISO() returning the local country for unknown country names
ClosedPublic

Authored by vkrause on May 20 2018, 3:10 PM.

Details

Summary

Better to show nothing rather than something random when the country name
is not recognized or contains a typo. More importantly, this actually
enables the caller to handle this case.

Diff Detail

Repository
R174 KContacts
Branch
master
Lint
No Linters Available
Unit
No Unit Test Coverage
vkrause created this revision.May 20 2018, 3:10 PM
Restricted Application added a project: KDE PIM. · View Herald TranscriptMay 20 2018, 3:10 PM
vkrause requested review of this revision.May 20 2018, 3:10 PM
winterz accepted this revision.May 20 2018, 3:25 PM
winterz added a subscriber: winterz.

I guess this QLocale::bcp47Name() is useless in this situation.

Right, we don't want a "dash-separated language, script and country (and possibly other BCP47 fields) of this locale as a string."

ship it

This revision is now accepted and ready to land.May 20 2018, 3:25 PM
This revision was automatically updated to reflect the committed changes.