Double fallback implemented (see #4396)

If the user's default profile is not found, it'll fallback to the
bundled one. If this one is not found, it'll fall back to internal
values. No restart required. Only the GUI alert are localized.
This commit is contained in:
Hombre
2018-02-24 14:02:50 +01:00
parent ff021826c6
commit b430ca19a6
6 changed files with 149 additions and 62 deletions

View File

@@ -163,6 +163,36 @@ int main (int argc, char **argv)
return -2;
}
if (options.is_defProfRawMissing()) {
options.defProfRaw = DEFPROFILE_RAW;
std::cerr << std::endl
<< "The default profile for raw photos could not be found or is not set." << std::endl
<< "Please check your profiles' directory, it may be missing or damaged." << std::endl
<< "\"" << DEFPROFILE_RAW << "\" will be used instead." << std::endl << std::endl;
}
if (options.is_bundledDefProfRawMissing()) {
std::cerr << std::endl
<< "The bundled profile \"" << options.defProfRaw << "\" could not be found!" << std::endl
<< "Your installation could be damaged." << std::endl
<< "Default internal values will be used instead." << std::endl << std::endl;
options.defProfRaw = DEFPROFILE_INTERNAL;
}
if (options.is_defProfImgMissing()) {
options.defProfImg = DEFPROFILE_IMG;
std::cerr << std::endl
<< "The default profile for non-raw photos could not be found or is not set." << std::endl
<< "Please check your profiles' directory, it may be missing or damaged." << std::endl
<< "\"" << DEFPROFILE_IMG << "\" will be used instead." << std::endl << std::endl;
}
if (options.is_bundledDefProfImgMissing()) {
std::cerr << std::endl
<< "The bundled profile " << options.defProfImg << " could not be found!" << std::endl
<< "Your installation could be damaged." << std::endl
<< "Default internal values will be used instead." << std::endl << std::endl;
options.defProfImg = DEFPROFILE_INTERNAL;
}
rtengine::setPaths();
TIFFSetWarningHandler (nullptr); // avoid annoying message boxes