Fixes NB#133900, some countries are missing in the country list
authorSergio Villar Senin <svillar@igalia.com>
Wed, 21 Oct 2009 07:42:52 +0000 (09:42 +0200)
committerSergio Villar Senin <svillar@igalia.com>
Wed, 21 Oct 2009 11:23:40 +0000 (13:23 +0200)
src/hildon2/modest-platform.c
src/maemo/modest-platform.c
src/mcc_mapping
src/mcc_mapping.en_GB [deleted file]
src/modest-utils.c
src/modest-utils.h

index 4e18836..1125cde 100644 (file)
@@ -139,26 +139,21 @@ on_modest_conf_update_interval_changed (ModestConf* self,
 static gboolean
 check_required_files (void)
 {
-       FILE *mcc_file = modest_utils_open_mcc_mapping_file (FALSE, NULL);
+       FILE *mcc_file = modest_utils_open_mcc_mapping_file ();
+
        if (!mcc_file) {
                g_printerr ("modest: check for mcc file (for LANG) failed\n");
                return FALSE;
-       } else 
-               fclose (mcc_file);
-       
-       mcc_file = modest_utils_open_mcc_mapping_file (TRUE, NULL);
-       if (!mcc_file) {
-               g_printerr ("modest: check for mcc file (for LC_MESSAGES) failed\n");
-               return FALSE;
-       } else 
+       } else {
                fclose (mcc_file);
-       
+       }
+
        if (access(MODEST_PROVIDER_DATA_FILE, R_OK) != 0 &&
            access(MODEST_FALLBACK_PROVIDER_DATA_FILE, R_OK) != 0) {
                g_printerr ("modest: cannot find providers data\n");
                return FALSE;
        }
-       
+
        return TRUE;
 }
 
index b54f5f4..1b54395 100644 (file)
@@ -103,20 +103,14 @@ on_modest_conf_update_interval_changed (ModestConf* self,
 static gboolean
 check_required_files (void)
 {
-       FILE *mcc_file = modest_utils_open_mcc_mapping_file (FALSE,NULL);
-       if (!mcc_file) {
-               g_printerr ("modest: check for mcc file failed\n");
-               return FALSE;
-       } else
-               fclose (mcc_file);
+       FILE *mcc_file = modest_utils_open_mcc_mapping_file ();
 
-
-       mcc_file = modest_utils_open_mcc_mapping_file (TRUE, NULL);
        if (!mcc_file) {
-               g_printerr ("modest: check for mcc file (for LC_MESSAGES) failed\n");
+               g_printerr ("modest: check for mcc file failed\n");
                return FALSE;
-       } else
+       } else {
                fclose (mcc_file);
+       }
 
        if (access(MODEST_PROVIDER_DATA_FILE, R_OK) != 0 &&
            access(MODEST_FALLBACK_PROVIDER_DATA_FILE, R_OK) != 0) {
index 3ecfa82..ff0862d 100644 (file)
-412    qtn_clk_country_afghanistan\r
-276    qtn_clk_country_albania\r
-603    qtn_clk_country_algeria\r
-544    qtn_clk_country_american_samoa\r
-213    qtn_clk_country_andorra\r
-631    qtn_clk_country_angola\r
-365    qtn_clk_country_anguilla\r
-344    qtn_clk_country_antigua_and_barbuda\r
-722    qtn_clk_country_argentina\r
-283    qtn_clk_country_armenia\r
-363    qtn_clk_country_aruba\r
-505    qtn_clk_country_australia\r
-232    qtn_clk_country_austria\r
-400    qtn_clk_country_azerbaijani_republic\r
-364    qtn_clk_country_bahamas\r
-426    qtn_clk_country_bahrain\r
-470    qtn_clk_country_bangladesh\r
-342    qtn_clk_country_barbados\r
-257    qtn_clk_country_belarus\r
-206    qtn_clk_country_belgium\r
-702    qtn_clk_country_belize\r
-616    qtn_clk_country_benin\r
-350    qtn_clk_country_bermuda\r
-402    qtn_clk_country_bhutan\r
-736    qtn_clk_country_bolivia\r
-218    qtn_clk_country_bosnia_and_herzegovina\r
-652    qtn_clk_country_botswana\r
-724    qtn_clk_country_brazil\r
-348    qtn_clk_country_british_virgin_islands\r
-528    qtn_clk_country_brunei_darussalam\r
-284    qtn_clk_country_bulgaria\r
-613    qtn_clk_country_burkina_faso\r
-642    qtn_clk_country_burundi\r
-456    qtn_clk_country_cambodia\r
-624    qtn_clk_country_cameroon\r
-302    qtn_clk_country_canada\r
-625    qtn_clk_country_cape_verde\r
-346    qtn_clk_country_cayman_islands\r
-623    qtn_clk_country_central_african_republic\r
-622    qtn_clk_country_chad\r
-730    qtn_clk_country_chile\r
-461    qtn_clk_country_china\r
-460    qtn_clk_country_china\r
-732    qtn_clk_country_colombia\r
-654    qtn_clk_country_comoros\r
-629    qtn_clk_country_republic_of_the_congo\r
-548    qtn_clk_country_cook_islands\r
-712    qtn_clk_country_costa_rica\r
-612    qtn_clk_country_cote_dlvoire\r
-219    qtn_clk_country_croatia\r
-368    qtn_clk_country_cuba\r
-280    qtn_clk_country_cyprus\r
-230    qtn_clk_country_czech_republic\r
-630    qtn_clk_country_democratic_republic_of_the_congo\r
-238    qtn_clk_country_denmark\r
-638    qtn_clk_country_djibouti\r
-366    qtn_clk_country_dominica\r
-370    qtn_clk_country_dominican_republic\r
-514    qtn_clk_country_east_timor\r
-740    qtn_clk_country_ecuador\r
-602    qtn_clk_country_egypt\r
-706    qtn_clk_country_el_salvador\r
-627    qtn_clk_country_equatorial_guinea\r
-657    qtn_clk_country_eritrea\r
-248    qtn_clk_country_estonia\r
-636    qtn_clk_country_ethiopia\r
-288    qtn_clk_country_faroe_islands\r
-542    qtn_clk_country_fiji\r
-244    qtn_clk_country_finland\r
-208    qtn_clk_country_france\r
-742    qtn_clk_country_french_guiana\r
-547    qtn_clk_country_french_polynesia\r
-628    qtn_clk_country_gobonese_republic\r
-607    qtn_clk_country_gambia\r
-282    qtn_clk_country_georgia\r
-262    qtn_clk_country_germany\r
-620    qtn_clk_country_ghana\r
-266    qtn_clk_country_gibraltar\r
-202    qtn_clk_country_greece\r
-290    qtn_clk_country_greenland\r
-352    qtn_clk_country_grenada\r
-340    qtn_clk_country_guadeloupe\r
-535    qtn_clk_country_guam\r
-704    qtn_clk_country_guatemala\r
-611    qtn_clk_country_guinea\r
-632    qtn_clk_country_guinea_bissaus\r
-738    qtn_clk_country_guyana\r
-372    qtn_clk_country_haiti\r
-708    qtn_clk_country_honduras\r
-454    qtn_clk_country_hong_kong\r
-216    qtn_clk_country_hungary\r
-274    qtn_clk_country_iceland\r
-404    qtn_clk_country_india\r
-510    qtn_clk_country_indonesia\r
-432    qtn_clk_country_iran\r
-418    qtn_clk_country_iraq\r
-272    qtn_clk_country_republic_of_ireland\r
-425    qtn_clk_country_israel\r
-222    qtn_clk_country_italy\r
-338    qtn_clk_country_jamaica\r
-441    qtn_clk_country_japan\r
-440    qtn_clk_country_japan\r
-416    qtn_clk_country_jordan\r
-401    qtn_clk_country_kazakhstan\r
-639    qtn_clk_country_kenya\r
-545    qtn_clk_country_kiribati\r
-467    qtn_clk_country_korea_north\r
-450    qtn_clk_country_country_south_korea\r
-419    qtn_clk_country_kuwait\r
-437    qtn_clk_country_kyrgyz_republic\r
-457    qtn_clk_country_laos\r
-247    qtn_clk_country_latvia\r
-415    qtn_clk_country_lebanon\r
-651    qtn_clk_country_lesotho\r
-618    qtn_clk_country_liberia\r
-606    qtn_clk_country_libya\r
-295    qtn_clk_country_liechtenstein\r
-246    qtn_clk_country_lithuania\r
-270    qtn_clk_country_luxembourg\r
-455    qtn_clk_country_macao\r
-294    qtn_clk_country_the_former_yugoslav_republic_of_macedonia\r
-646    qtn_clk_country_madagascar\r
-650    qtn_clk_country_malawi\r
-502    qtn_clk_country_malaysia\r
-472    qtn_clk_country_maldives\r
-610    qtn_clk_country_mali\r
-278    qtn_clk_country_malta\r
-551    qtn_clk_country_marshall_islands\r
-340    qtn_clk_country_martinique\r
-609    qtn_clk_country_mauritania\r
-617    qtn_clk_country_mauritius\r
-334    qtn_clk_country_mexico\r
-550    qtn_clk_country_micronesia\r
-259    qtn_clk_country_republic_of_moldova\r
-212    qtn_clk_country_monaco\r
-428    qtn_clk_country_mongolia\r
-354    qtn_clk_country_montserrat\r
-604    qtn_clk_country_morocco\r
-643    qtn_clk_country_mozambique\r
-414    qtn_clk_country_myanmar\r
-649    qtn_clk_country_namibia\r
-536    qtn_clk_country_nauru\r
-429    qtn_clk_country_nepal\r
-204    qtn_clk_country_netherlands\r
-362    qtn_clk_country_netherlands_antilles\r
-546    qtn_clk_country_new_caledonia\r
-530    qtn_clk_country_new_zealand\r
-710    qtn_clk_country_nicaraqua\r
-614    qtn_clk_country_niger\r
-621    qtn_clk_country_nigeria\r
-534    qtn_clk_country_northern_mariana_islands\r
-242    qtn_clk_country_norway\r
-422    qtn_clk_country_oman\r
-410    qtn_clk_country_pakistan\r
-552    qtn_clk_country_palau\r
-714    qtn_clk_country_panama\r
-537    qtn_clk_country_papua_new_guinea\r
-744    qtn_clk_country_paraquay\r
-716    qtn_clk_country_peru\r
-515    qtn_clk_country_philippines\r
-260    qtn_clk_country_poland\r
-268    qtn_clk_country_portugal\r
-330    qtn_clk_country_puerto_rico\r
-427    qtn_clk_country_qatar\r
-647    qtn_clk_country_reunion\r
-226    qtn_clk_country_romania\r
-250    qtn_clk_country_russian_federation\r
-635    qtn_clk_country_rwandese_republic\r
-356    qtn_clk_country_saint_kitts_and_nevis\r
-358    qtn_clk_country_saint_lucia\r
-308    qtn_clk_country_saint_pierre_and_miquelon\r
-360    qtn_clk_country_saint_vincent_and_grenadines\r
-549    qtn_clk_country_samoa\r
-292    qtn_clk_country_san_marino\r
-626    qtn_clk_country_sao_tome_and_principe\r
-420    qtn_clk_country_saudi_arabia\r
-608    qtn_clk_country_senegal\r
-220    qtn_clk_country_serbia_and_montenegro\r
-633    qtn_clk_country_seychelles\r
-619    qtn_clk_country_sierra_leone\r
-525    qtn_clk_country_singapore\r
-231    qtn_clk_country_slovakia\r
-293    qtn_clk_country_slovenia\r
-540    qtn_clk_country_solomon_islands\r
-637    qtn_clk_country_somalia\r
-655    qtn_clk_country_south_africa\r
-214    qtn_clk_country_spain\r
-413    qtn_clk_country_sri_lanka\r
-634    qtn_clk_country_sudan\r
-746    qtn_clk_country_suriname\r
-653    qtn_clk_country_swaziland\r
-240    qtn_clk_country_sweden\r
-228    qtn_clk_country_switzerland\r
-417    qtn_clk_country_syrian_arab_republic\r
-466    qtn_clk_country_taiwan\r
-436    qtn_clk_country_tajikistan\r
-640    qtn_clk_country_united_republic_of_tanzania\r
-520    qtn_clk_country_thailand\r
-615    qtn_clk_country_togolese_republic\r
-539    qtn_clk_country_tonga\r
-374    qtn_clk_country_trinidad_and_tobago\r
-605    qtn_clk_country_tunisia\r
-286    qtn_clk_country_turkey\r
-438    qtn_clk_country_turkmenistan\r
-376    qtn_clk_country_turks_and_caicos_islands\r
-641    qtn_clk_country_uganda\r
-255    qtn_clk_country_ukraine\r
-424    qtn_clk_country_united_arab_emirates\r
-430    qtn_clk_country_united_arab_emirates_abu_dhabi\r
-431    qtn_clk_country_united_arab_emirates_dubai\r
-235    qtn_clk_country_united_kingdom_of_great_britain_and_northern_ireland\r
-234    qtn_clk_country_united_kingdom_of_great_britain_and_northern_ireland\r
-310    qtn_clk_country_united_states_of_america\r
-316    qtn_clk_country_united_states_of_america\r
-311    qtn_clk_country_united_states_of_america\r
-312    qtn_clk_country_united_states_of_america\r
-313    qtn_clk_country_united_states_of_america\r
-314    qtn_clk_country_united_states_of_america\r
-315    qtn_clk_country_united_states_of_america\r
-332    qtn_clk_country_unites_states_virgin_islands\r
-748    qtn_clk_country_uruguay\r
-434    qtn_clk_country_uzbekistan\r
-541    qtn_clk_country_vanuatu\r
-225    qtn_clk_country_the_vatican\r
-734    qtn_clk_country_venezuela\r
-452    qtn_clk_country_viet_nam\r
-543    qtn_clk_country_wallis_and_futuna\r
-421    qtn_clk_country_yemen\r
-645    qtn_clk_country_zambia\r
-648    qtn_clk_country_zimbabwe\r
+412    qtn_clk_country_afghanistan
+276    qtn_clk_country_albania
+603    qtn_clk_country_algeria
+544    qtn_clk_country_samoa
+213    qtn_clk_country_andorra
+631    qtn_clk_country_angola
+365    qtn_clk_country_anguilla
+344    qtn_clk_country_antigua_barbuda
+722    qtn_clk_country_argentina
+283    qtn_clk_country_armenia
+363    qtn_clk_country_aruba
+505    qtn_clk_country_australia
+232    qtn_clk_country_austria
+400    qtn_clk_country_azerbaijan
+364    qtn_clk_country_bahamas
+426    qtn_clk_country_bahrain
+470    qtn_clk_country_bangladesh
+342    qtn_clk_country_barbados
+257    qtn_clk_country_belarus
+206    qtn_clk_country_belgium
+702    qtn_clk_country_belize
+616    qtn_clk_country_benin
+350    qtn_clk_country_bermuda
+402    qtn_clk_country_bhutan
+736    qtn_clk_country_bolivia
+218    qtn_clk_country_bosnia_herz
+652    qtn_clk_country_botswana
+724    qtn_clk_country_brazil
+348    qtn_clk_country_uk
+528    qtn_clk_country_brunei
+284    qtn_clk_country_bulgaria
+613    qtn_clk_country_burkina_faso
+642    qtn_clk_country_burundi
+456    qtn_clk_country_cambodia
+624    qtn_clk_country_cameroon
+302    qtn_clk_country_canada
+625    qtn_clk_country_cap_verde
+346    qtn_clk_country_cayman_islands
+623    qtn_clk_country_car
+622    qtn_clk_country_chad
+730    qtn_clk_country_chile
+460    qtn_clk_country_china
+732    qtn_clk_country_colombia
+654    qtn_clk_country_comoros
+629    qtn_clk_country_r_congo
+548    qtn_clk_country_cook_islands
+712    qtn_clk_country_costa_rica
+612    qtn_clk_country_cotedlvoire
+219    qtn_clk_country_croatia
+368    qtn_clk_country_cuba
+280    qtn_clk_country_cyprus
+230    qtn_clk_country_czech_reb
+630    qtn_clk_country_r_congo
+238    qtn_clk_country_denmark
+638    qtn_clk_country_djibouti
+366    qtn_clk_country_dominica
+370    qtn_clk_country_dominican_reb
+514    qtn_clk_country_east_timor
+740    qtn_clk_country_ecuador
+602    qtn_clk_country_egypt
+706    qtn_clk_country_el_salvador
+627    qtn_clk_country_equatorial_guinea
+657    qtn_clk_country_eritrea
+248    qtn_clk_country_estonia
+636    qtn_clk_country_ethiopia
+288    qtn_clk_country_faroe_islands
+542    qtn_clk_country_fiji
+244    qtn_clk_country_finland
+208    qtn_clk_country_france
+742    qtn_clk_country_french_guiana
+547    qtn_clk_country_french_polynesia
+628    qtn_clk_country_gabon
+607    qtn_clk_country_gambia
+282    qtn_clk_country_georgia
+262    qtn_clk_country_germany
+620    qtn_clk_country_ghana
+266    qtn_clk_country_gibraltar
+202    qtn_clk_country_greece
+290    qtn_clk_country_greenland
+352    qtn_clk_country_grenada
+340    qtn_clk_country_guadeloupe
+535    qtn_clk_country_guam
+704    qtn_clk_country_guatemala
+611    qtn_clk_country_guinea
+632    qtn_clk_country_guinea_bissau
+738    qtn_clk_country_guyana
+372    qtn_clk_country_haiti
+708    qtn_clk_country_honduras
+454    qtn_clk_country_hong_kong
+216    qtn_clk_country_hungary
+274    qtn_clk_country_iceland
+404    qtn_clk_country_india
+405    qtn_clk_country_india
+510    qtn_clk_country_indonesia
+432    qtn_clk_country_iran
+418    qtn_clk_country_iraq
+272    qtn_clk_country_ireland
+425    qtn_clk_country_israel
+222    qtn_clk_country_italy
+338    qtn_clk_country_jamaica
+441    qtn_clk_country_japan
+440    qtn_clk_country_japan
+416    qtn_clk_country_jordan
+401    qtn_clk_country_kazakhstan
+639    qtn_clk_country_kenya
+545    qtn_clk_country_kiribati
+467    qtn_clk_country_north_korea
+450    qtn_clk_country_south_korea
+419    qtn_clk_country_kuwait
+437    qtn_clk_country_kyrgyzstan
+457    qtn_clk_country_laos
+247    qtn_clk_country_latvia
+415    qtn_clk_country_lebanon
+651    qtn_clk_country_lesotho
+618    qtn_clk_country_liberia
+606    qtn_clk_country_libya
+295    qtn_clk_country_liechtenstein
+246    qtn_clk_country_lithuania
+270    qtn_clk_country_luxembourg
+455    qtn_clk_region_macau
+294    qtn_clk_country_macedonia
+646    qtn_clk_country_madagascar
+650    qtn_clk_country_malawi
+502    qtn_clk_country_malaysia
+472    qtn_clk_country_maldives
+610    qtn_clk_country_mali
+278    qtn_clk_country_malta
+551    qtn_clk_country_marshall_islands
+340    qtn_clk_country_martinique
+609    qtn_clk_country_mauritania
+617    qtn_clk_country_mauritius
+334    qtn_clk_country_mexico
+550    qtn_clk_country_micronesia
+259    qtn_clk_country_moldova
+212    qtn_clk_country_monaco
+428    qtn_clk_country_mongolia
+354    qtn_clk_country_montserrat
+604    qtn_clk_country_morocco
+643    qtn_clk_country_mozambique
+414    qtn_clk_country_myanmar
+649    qtn_clk_country_namibia
+536    qtn_clk_country_nauru
+429    qtn_clk_country_nepal
+204    qtn_clk_country_netherlands
+362    qtn_clk_country_netherlands
+546    qtn_clk_country_new_caledonia
+530    qtn_clk_country_new_zealand
+710    qtn_clk_country_nicaragua
+614    qtn_clk_country_niger
+621    qtn_clk_country_nigeria
+534    qtn_clk_country_n_mariana_i
+242    qtn_clk_country_norway
+422    qtn_clk_country_oman
+410    qtn_clk_country_pakistan
+552    qtn_clk_country_palau
+714    qtn_clk_country_panama
+537    qtn_clk_country_papua_new_g
+744    qtn_clk_country_paraguay
+716    qtn_clk_country_peru
+515    qtn_clk_country_philippines
+260    qtn_clk_country_poland
+268    qtn_clk_country_portugal
+330    qtn_clk_country_puerto_rico
+427    qtn_clk_country_qatar
+647    qtn_clk_country_reunion
+226    qtn_clk_country_romania
+250    qtn_clk_country_russia
+635    qtn_clk_country_rwanda
+356    qtn_clk_country_st_kitts_nevis
+358    qtn_clk_country_st_lucia
+308    qtn_clk_country_st_pierre_miquelon
+360    qtn_clk_country_st_vincent_granadines
+549    qtn_clk_country_usa
+292    qtn_clk_country_san_marino
+626    qtn_clk_country_sao_tome_principe
+420    qtn_clk_country_saudi_arab
+608    qtn_clk_country_senegal
+220    qtn_clk_country_serbia
+220    qtn_clk_country_montenegro
+633    qtn_clk_country_seychelles
+619    qtn_clk_country_sierra_leone
+525    qtn_clk_country_singapore
+231    qtn_clk_country_slovakia
+293    qtn_clk_country_slovenia
+540    qtn_clk_country_solomon_is
+637    qtn_clk_country_somalia
+655    qtn_clk_country_south_africa
+214    qtn_clk_country_spain
+413    qtn_clk_country_sri_lanka
+634    qtn_clk_country_sudan
+746    qtn_clk_country_suriname
+653    qtn_clk_country_swaziland
+240    qtn_clk_country_sweden
+228    qtn_clk_country_switzerland
+417    qtn_clk_country_syria
+466    qtn_clk_country_taiwan
+436    qtn_clk_country_tajikistan
+640    qtn_clk_country_tanzania
+520    qtn_clk_country_thailand
+615    qtn_clk_country_togo
+539    qtn_clk_country_tonga
+374    qtn_clk_country_trinid_tobago
+605    qtn_clk_country_tunisia
+286    qtn_clk_country_turkey
+438    qtn_clk_country_turkmenistan
+376    qtn_clk_country_turks_caicos
+641    qtn_clk_country_uganda
+255    qtn_clk_country_ukraine
+424    qtn_clk_country_arab_emirates
+430    qtn_clk_country_arab_emirates
+431    qtn_clk_country_arab_emirates
+235    qtn_clk_country_uk
+234    qtn_clk_country_uk
+310    qtn_clk_country_usa
+316    qtn_clk_country_usa
+311    qtn_clk_country_usa
+312    qtn_clk_country_usa
+313    qtn_clk_country_usa
+314    qtn_clk_country_usa
+315    qtn_clk_country_usa
+332    qtn_clk_country_usa
+748    qtn_clk_country_uruguay
+434    qtn_clk_country_uzbekistan
+541    qtn_clk_country_vanuatu
+225    qtn_clk_country_vatican
+734    qtn_clk_country_venezuela
+452    qtn_clk_country_vietnam
+543    qtn_clk_country_wallis_futuna
+421    qtn_clk_country_yemen
+645    qtn_clk_country_zambia
+648    qtn_clk_country_zimbabwe
diff --git a/src/mcc_mapping.en_GB b/src/mcc_mapping.en_GB
deleted file mode 100644 (file)
index 491e504..0000000
+++ /dev/null
@@ -1,107 +0,0 @@
-276    Albania\r
-213    Andorra\r
-722    Argentina\r
-363    Aruba\r
-505    Australia\r
-232    Austria\r
-400    Azerbaijan\r
-426    Bahrain\r
-470    Bangladesh\r
-257    Belarus\r
-206    Belgium\r
-736    Bolivia\r
-218    Bosnia and Herzegovina\r
-652    Botswana\r
-724    Brazil\r
-528    Brunei Darussalam\r
-284    Bulgaria\r
-456    Cambodia\r
-302    Canada\r
-730    Chile\r
-460    China\r
-732    Colombia\r
-219    Croatia\r
-280    Cyprus\r
-230    Czech Republic\r
-238    Denmark\r
-370    Dominican Republic\r
-740    Ecuador\r
-602    Egypt\r
-706    El Salvador\r
-248    Estonia\r
-244    Finland\r
-208    France\r
-282    Georgia\r
-262    Germany\r
-620    Ghana\r
-266    Gibraltar\r
-202    Greece\r
-340    Guadeloupe\r
-704    Guatemala\r
-708    Honduras\r
-454    Hong Kong, China\r
-216    Hungary\r
-274    Iceland\r
-404    India\r
-510    Indonesia\r
-272    Ireland\r
-425    Israel\r
-222    Italy\r
-338    Jamaica\r
-440    Japan\r
-416    Jordan\r
-401    Kazakhstan\r
-639    Kenya\r
-419    Kuwait\r
-247    Latvia\r
-415    Lebanon\r
-295    Liechtenstein\r
-246    Lithuania\r
-270    Luxembourg\r
-455    Macao, China\r
-294    Macedonia\r
-502    Malaysia\r
-472    Maldives\r
-278    Malta\r
-340    Martinique\r
-334    Mexico\r
-259    Moldova\r
-212    Monaco\r
-428    Mongolia\r
-220    Montenegro\r
-604    Morocco\r
-204    Netherlands\r
-530    New Zealand\r
-621    Nigeria\r
-242    Norway\r
-422    Oman\r
-410    Pakistan\r
-714    Panama\r
-744    Paraguay\r
-716    Peru\r
-515    Philippines\r
-260    Poland\r
-268    Portugal\r
-427    Qatar\r
-226    Romania\r
-250    Russian Federation\r
-420    Saudi Arabia\r
-220    Serbia\r
-525    Singapore\r
-231    Slovakia\r
-293    Slovenia\r
-655    South Africa\r
-214    Spain\r
-413    Sri Lanka\r
-240    Sweden\r
-228    Switzerland\r
-417    Syria\r
-466    Taiwan\r
-520    Thailand\r
-374    Trinidad and Tobago\r
-286    Turkey\r
-255    Ukraine\r
-234    United Kingdom\r
-748    Uruguay\r
-310    USA\r
-734    Venezuela\r
index 358228c..1f09385 100644 (file)
@@ -833,60 +833,27 @@ modest_utils_on_entry_invalid_character (ModestValidatingEntry *self,
 }
 
 FILE*
-modest_utils_open_mcc_mapping_file (gboolean from_lc_messages, gboolean *translated)
+modest_utils_open_mcc_mapping_file (void)
 {
        FILE* result = NULL;
        const gchar* path;
-       const gchar *env_list;
-       gchar **parts, **node;
 
-       if (from_lc_messages) {
-               env_list = setlocale (LC_MESSAGES, NULL);
+       if (access (MODEST_OPERATOR_WIZARD_MCC_MAPPING, R_OK) == 0) {
+               path = MODEST_OPERATOR_WIZARD_MCC_MAPPING;
+       } else if (access (MODEST_MCC_MAPPING, R_OK) == 0) {
+               path = MODEST_MCC_MAPPING;
        } else {
-               env_list = getenv ("LANG");
-       }
-       parts = g_strsplit (env_list, ":", 0);
-       gchar *path1 = NULL;
-       const gchar* path2 = MODEST_MCC_MAPPING;
-
-       if (translated)
-               *translated = TRUE;
-
-       path = NULL;
-       for (node = parts; path == NULL && node != NULL && *node != NULL && **node != '\0'; node++) {
-               path1 = g_strdup_printf ("%s.%s", MODEST_OPERATOR_WIZARD_MCC_MAPPING, *node);
-               if (access (path1, R_OK) == 0) {
-                       path = path1;
-                       break;
-               } else {
-                       g_free (path1);
-                       path1 = NULL;
-               }
-       }
-       g_strfreev (parts);
-
-       if (path == NULL) {
-               if (access (MODEST_OPERATOR_WIZARD_MCC_MAPPING, R_OK) == 0) {
-                       path = MODEST_OPERATOR_WIZARD_MCC_MAPPING;
-                       if (translated)
-                               *translated = FALSE;
-               } else if (access (path2, R_OK) == 0) {
-                       path = path2;
-               } else {
-                       g_warning ("%s: neither '%s' nor '%s' is a readable mapping file",
-                                  __FUNCTION__, path1, path2);
-                       goto end;
-               }
+               g_warning ("%s: neither '%s' nor '%s' is a readable mapping file",
+                          __FUNCTION__, MODEST_OPERATOR_WIZARD_MCC_MAPPING, MODEST_MCC_MAPPING);
+               return NULL;
        }
 
        result = fopen (path, "r");
        if (!result) {
                g_warning ("%s: error opening mapping file '%s': %s",
                           __FUNCTION__, path, strerror(errno));
-               goto end;
        }
- end:
-       g_free (path1);
+
        return result;
 }
 
@@ -942,8 +909,9 @@ parse_mcc_mapping_line (const char* line,  char** country)
        *country = g_utf8_find_next_char (tab, NULL);
 
        /* Replace by end of string. We need to use strlen, because
-          g_utf8_strrchr expects bytes and not UTF8 characters  */
-       final = g_utf8_strrchr (tab, strlen (tab) + 1, '\n');
+          g_utf8_strrchr expects bytes and not UTF8 characters. File
+          lines end with \r\n */
+       final = g_utf8_strrchr (tab, strlen (tab) + 1, '\r');
        if (G_LIKELY (final))
                *final = '\0';
        else
@@ -978,7 +946,6 @@ modest_utils_create_country_model (void)
 void
 modest_utils_fill_country_model (GtkTreeModel *model, gint *locale_mcc)
 {
-       gboolean translated;
        char line[MCC_FILE_MAX_LINE_LEN];
        guint previous_mcc = 0;
        gchar *territory;
@@ -986,7 +953,7 @@ modest_utils_fill_country_model (GtkTreeModel *model, gint *locale_mcc)
        FILE *file;
 
        /* First we need to know our current region */
-       file = modest_utils_open_mcc_mapping_file (FALSE, &translated);
+       file = modest_utils_open_mcc_mapping_file ();
        if (!file) {
                g_warning ("Could not open mcc_mapping file");
                return;
@@ -1012,25 +979,14 @@ modest_utils_fill_country_model (GtkTreeModel *model, gint *locale_mcc)
                previous_mcc = mcc;
 
                if (!(*locale_mcc)) {
-                       if (translated) {
-                               if (!g_utf8_collate (country, territory))
-                                       *locale_mcc = mcc;
-                       } else {
-                               gchar *translation = dgettext ("osso-countries", country);
-                               if (!g_utf8_collate (translation, territory))
-                                       *locale_mcc = mcc;
-                       }
+                       gchar *translation = dgettext ("osso-countries", country);
+                       if (!g_utf8_collate (translation, territory))
+                               *locale_mcc = mcc;
                }
        }
-       fclose (file);
 
        /* Now we fill the model */
-       file = modest_utils_open_mcc_mapping_file (TRUE, &translated);
-       if (!file) {
-               g_warning ("Could not open mcc_mapping file");
-               return;
-       }
-
+       rewind (file);
        country_hash = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, NULL);
        while (fgets (line, MCC_FILE_MAX_LINE_LEN, file) != NULL) {
 
@@ -1056,12 +1012,16 @@ modest_utils_fill_country_model (GtkTreeModel *model, gint *locale_mcc)
 
                name_translated = dgettext ("osso-countries", country);
 
-               /* Add the row to the model: */
-               gtk_list_store_append (GTK_LIST_STORE (model), &iter);
-               gtk_list_store_set(GTK_LIST_STORE (model), &iter, 
-                                  MODEST_UTILS_COUNTRY_MODEL_COLUMN_MCC, mcc, 
-                                  MODEST_UTILS_COUNTRY_MODEL_COLUMN_NAME, name_translated, 
-                                  -1);
+               /* Add the row to the model if we have translation for it */
+               if (g_utf8_collate (country, name_translated)) {
+                       gtk_list_store_append (GTK_LIST_STORE (model), &iter);
+                       gtk_list_store_set(GTK_LIST_STORE (model), &iter,
+                                          MODEST_UTILS_COUNTRY_MODEL_COLUMN_MCC, mcc,
+                                          MODEST_UTILS_COUNTRY_MODEL_COLUMN_NAME, name_translated,
+                                          -1);
+               } else {
+                       g_debug ("%s no translation for %s", __FUNCTION__, country);
+               }
        }
 
 
index ffc1ae2..669d778 100644 (file)
@@ -202,12 +202,11 @@ void modest_utils_on_entry_invalid_character (ModestValidatingEntry *self,
  * modest_utils_open_mcc_mapping_file:
  * @translated: a #gboolean pointer
  *
- * open the mcc mapping file, or %NULL if it fails. It also
- * sets @translated to %TRUE if the file is translated
+ * open the mcc mapping file, or %NULL if it fails
  *
  * Returns: file ptr or %NULL in case of error
  */
-FILE* modest_utils_open_mcc_mapping_file (gboolean from_lc_messages, gboolean *translated);
+FILE* modest_utils_open_mcc_mapping_file (void);
 
 typedef enum {
        MODEST_UTILS_COUNTRY_MODEL_COLUMN_NAME = 0,