From: Murray Cumming Date: Mon, 11 Jun 2007 12:29:24 +0000 (+0000) Subject: 2007-06-11 Murray Cumming X-Git-Tag: git_migration_finished~3350 X-Git-Url: http://git.maemo.org/git/?p=modest;a=commitdiff_plain;h=3d91529efda77d4721e1de09e5d49586815cd724;ds=sidebyside 2007-06-11 Murray Cumming * src/maemo/easysetup/modest-easysetup-provider-combo-box.c: (easysetup_provider_combo_box_fill): Ask for the providers for mmc=0 when no country was selected, so that we show the global ones. * src/maemo/easysetup/modest-presets.c: (modest_presets_get_providers): Return only the global providers, not all providers when mmc=0 was requested. pmo-trunk-r2152 --- diff --git a/ChangeLog2 b/ChangeLog2 index 55d5aa7..5b81623 100644 --- a/ChangeLog2 +++ b/ChangeLog2 @@ -1,6 +1,15 @@ 2007-06-11 Murray Cumming * src/maemo/easysetup/modest-easysetup-provider-combo-box.c: + (easysetup_provider_combo_box_fill): Ask for the providers for mmc=0 + when no country was selected, so that we show the global ones. + * src/maemo/easysetup/modest-presets.c: + (modest_presets_get_providers): Return only the global providers, not + all providers when mmc=0 was requested. + +2007-06-11 Murray Cumming + + * src/maemo/easysetup/modest-easysetup-provider-combo-box.c: (easysetup_provider_combo_box_fill): Remove debug code that showed the provider ID in the combo. diff --git a/src/maemo/easysetup/modest-easysetup-provider-combo-box.c b/src/maemo/easysetup/modest-easysetup-provider-combo-box.c index 48914a0..b3b7a41 100644 --- a/src/maemo/easysetup/modest-easysetup-provider-combo-box.c +++ b/src/maemo/easysetup/modest-easysetup-provider-combo-box.c @@ -144,6 +144,15 @@ easysetup_provider_combo_box_new (void) void easysetup_provider_combo_box_fill (EasysetupProviderComboBox *combobox, ModestPresets *presets, GSList * list_country_id) { + /* If the list is empty then use mmc=0 to get the providers for all countries: */ + GSList *list = list_country_id; + GSList *fake_list = NULL; + if (!list_country_id) { + fake_list = g_slist_append(fake_list, GUINT_TO_POINTER(0)); + list = fake_list; + } + + EasysetupProviderComboBoxPrivate *priv = PROVIDER_COMBO_BOX_GET_PRIVATE (combobox); /* Remove any existing rows: */ @@ -152,7 +161,7 @@ void easysetup_provider_combo_box_fill (EasysetupProviderComboBox *combobox, Mod GSList *provider_ids_used_already = NULL; - GSList *iter_ids = list_country_id; + GSList *iter_ids = list; while (iter_ids) { const guint country_id = GPOINTER_TO_UINT (iter_ids->data); @@ -202,7 +211,6 @@ void easysetup_provider_combo_box_fill (EasysetupProviderComboBox *combobox, Mod iter_ids = g_slist_next (iter_ids); } - /* Add the "Other" item: */ /* Note that ID 0 means "Other" for us: */ /* TODO: We need a Logical ID for this text. */ @@ -215,6 +223,9 @@ void easysetup_provider_combo_box_fill (EasysetupProviderComboBox *combobox, Mod g_slist_foreach (provider_ids_used_already, (GFunc)g_free, NULL); g_slist_free (provider_ids_used_already); + + if (fake_list) + g_slist_free (fake_list); } /** diff --git a/src/maemo/easysetup/modest-presets.c b/src/maemo/easysetup/modest-presets.c index 0a6df35..69cd691 100644 --- a/src/maemo/easysetup/modest-presets.c +++ b/src/maemo/easysetup/modest-presets.c @@ -115,10 +115,12 @@ modest_presets_get_providers (ModestPresets *self, guint mcc, }; /* return *all* providers? */ + /* if (mcc == 0 && include_globals) { *provider_ids = all_provider_ids; return all_providers; } + */ /* nope: filter them */