- EasysetupCountryComboBoxPrivate *priv = COUNTRY_COMBO_BOX_GET_PRIVATE (self);
- GtkListStore *liststore = GTK_LIST_STORE (priv->model);
-
- char line[MAX_LINE_LEN];
- guint previous_mcc = 0;
-
- FILE *file = modest_maemo_open_mcc_mapping_file ();
- if (!file) {
- g_warning("Could not open mcc_mapping file");
- return;
- }
-
- while (fgets (line, MAX_LINE_LEN, file) > 0) {
-
- int mcc;
- char *country = NULL;
- mcc = parse_mcc_mapping_line (line, &country);
- if (!country || mcc == 0) {
- g_warning ("%s: error parsing line: '%s'", __FUNCTION__, line);
- continue;
- }
-
- if (mcc == previous_mcc) {
- /* g_warning ("already seen: %s", line); */
- continue;
- }
- previous_mcc = mcc;
-
- /* Get the translation for the country name:
- * Note that the osso_countries_1.0 translation domain files are installed
- * by the operator-wizard-settings package. */
- /* For post-Bora, there is a separate (meta)package osso-countries-l10n-mr0 */
-
- /* Note: Even when the untranslated names are different, there may still be
- * duplicate translated names. They would be translation bugs.
- */
- const gchar *name_translated = dgettext ("osso-countries", country);
-
- /* Add the row to the model: */
- GtkTreeIter iter;
- gtk_list_store_append (liststore, &iter);
- gtk_list_store_set(liststore, &iter, MODEL_COL_MCC, mcc, MODEL_COL_NAME, name_translated, -1);
- }
- fclose (file);
-
- /* Sort the items: */
- gtk_tree_sortable_set_sort_column_id (GTK_TREE_SORTABLE (liststore),
- MODEL_COL_NAME, GTK_SORT_ASCENDING);