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

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



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

R174 PIM: KContacts
Automatic diff as part of commit; lint not applicable.
Automatic diff as part of commit; unit tests not applicable.
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.