[TD]handle bad preferences in AppImage temp dir

This commit is contained in:
wandererfan
2020-08-13 13:26:14 -04:00
committed by WandererFan
parent 1c432fd617
commit f56825c79f
5 changed files with 34 additions and 36 deletions

View File

@@ -266,9 +266,12 @@ std::string DrawHatch::prefSvgHatch(void)
std::string defaultDir = App::Application::getResourceDir() + "Mod/TechDraw/Patterns/";
std::string defaultFileName = defaultDir + "simple.svg";
std::string result = hGrp->GetASCII("FileHatch",defaultFileName.c_str());
if (result.empty()) {
std::string prefHatchFile = hGrp->GetASCII("FileHatch",defaultFileName.c_str());
std::string result = prefHatchFile;
Base::FileInfo fi(result);
if (!fi.isReadable()) {
result = defaultFileName;
Base::Console().Warning("Svg Hatch File: %s is not readable\n", prefHatchFile.c_str());
}
return result;
}