2007-04-03 Murray Cumming <murrayc@murrayc.com>
+ * src/maemo/easysetup/modest-easysetup-country-combo-box.c:
+ (load_from_file):
+ * src/maemo/easysetup/modest-easysetup-wizard.c:
+ (modest_easysetup_wizard_dialog_init):
+ * src/maemo/easysetup/modest-presets.c: (modest_presets_new):
+ Use realistic paths (though they should use $prefix generically) to the
+ mcc_mapping and provider-data.keyfile files which might work when they
+ are installed by the future version of the operator-wizard package,
+ and then fallback to paths in our source code, with an explanatory
+ warning.
+
+2007-04-03 Murray Cumming <murrayc@murrayc.com>
+
* configure.ac:
* src/Makefile.am:
* src/maemo/Makefile.am:
EasysetupCountryComboBoxPrivate *priv = COUNTRY_COMBO_BOX_GET_PRIVATE (self);
/* Load the file one line at a time: */
- FILE *file = fopen("mcc_mapping", "r");
+ const gchar* filepath = "/usr/share/operator-wizard/mcc_mapping";
+ FILE *file = fopen(filepath, "r");
if (!file)
{
- g_warning("Could not open mcc_mapping file.\n");
+ const gchar* filepath_hack = "./src/maemo/easysetup/mcc_mapping";
+ g_warning ("Could not locate the official mcc_mapping countries list file from %s, "
+ "so attempting to load it instead from %s", filepath, filepath_hack);
+ file = fopen(filepath_hack, "r");
+ }
+
+ if (!file) {
+ g_warning("Could not open mcc_mapping file");
return;
}
/* Read in the information about known service providers: */
ModestEasysetupWizardDialogPrivate *priv = WIZARD_DIALOG_GET_PRIVATE (self);
- priv->presets = modest_presets_new ("provider-data-test.keyfile"); /* TODO: the actual filepath. */
-
+
+ const gchar* filepath = "/usr/share/operator-wizard/provider-data.keyfile";
+ priv->presets = modest_presets_new (filepath); /* TODO: the actual filepath. */
+ if (!(priv->presets))
+ {
+ const gchar* filepath_hack = "./src/maemo/easysetup/provider-data-test.keyfile";
+ g_warning ("Could not locate the official provider data keyfile from %s, "
+ "so attempting to load it instead from %s", filepath, filepath_hack);
+ priv->presets = modest_presets_new (filepath_hack); /* TODO: the actual filepath. */
+ }
+
+ g_assert(priv->presets);
+
+
/* Create the account manager object,
* so we can check for existing accounts,
* and create new accounts: */
if (!g_key_file_load_from_file (presets->keyfile, presetfile,
G_KEY_FILE_NONE, &err)) {
- g_printerr ("modest: cannot open keyfile: %s\n",
+ g_printerr ("modest: cannot open keyfile from %s:\n %s\n", presetfile,
err ? err->message : "unknown reason");
g_error_free (err);
g_free (presets);