- const gchar* filepath = MODEST_PROVIDERS_DATA_PATH; /* Defined in config.h */
- presets = modest_presets_new (filepath);
- if (!(presets)) {
- g_warning ("Could not locate the official provider data keyfile from %s", filepath);
+ const gchar* path = NULL;
+ const gchar* path1 = MODEST_PROVIDER_DATA_FILE;
+ const gchar* path2 = MODEST_MAEMO_PROVIDER_DATA_FILE;
+
+ if (access(path1, R_OK) == 0)
+ path = path1;
+ else if (access(path2, R_OK) == 0)
+ path = path2;
+ else {
+ g_warning ("%s: neither '%s' nor '%s' is a readable provider data file",
+ __FUNCTION__, path1, path2);
+ return NULL;