mirror of https://github.com/vitalif/openscad
#1254 Backport some code to boost filesystem V2, for old RedHat version
parent
e21b321323
commit
0e1b0daf36
|
@ -23,7 +23,7 @@ const char *PlatformUtils::OPENSCAD_FOLDER_NAME = "OpenSCAD";
|
||||||
static std::string lookupResourcesPath()
|
static std::string lookupResourcesPath()
|
||||||
{
|
{
|
||||||
fs::path resourcedir(applicationpath);
|
fs::path resourcedir(applicationpath);
|
||||||
PRINTDB("Looking up resource folder with application path '%s'", resourcedir.c_str());
|
PRINTDB("Looking up resource folder with application path '%s'", boosty::stringy(resourcedir).c_str());
|
||||||
|
|
||||||
#ifdef __APPLE__
|
#ifdef __APPLE__
|
||||||
const char *searchpath[] = {
|
const char *searchpath[] = {
|
||||||
|
@ -57,11 +57,11 @@ static std::string lookupResourcesPath()
|
||||||
tmpdir = resourcedir / searchpath[a];
|
tmpdir = resourcedir / searchpath[a];
|
||||||
|
|
||||||
const fs::path checkdir = tmpdir / "libraries";
|
const fs::path checkdir = tmpdir / "libraries";
|
||||||
PRINTDB("Checking '%s'", checkdir.c_str());
|
PRINTDB("Checking '%s'", boosty::stringy(checkdir).c_str());
|
||||||
|
|
||||||
if (is_directory(checkdir)) {
|
if (is_directory(checkdir)) {
|
||||||
resourcedir = tmpdir;
|
resourcedir = tmpdir;
|
||||||
PRINTDB("Found resource folder '%s'", tmpdir.c_str());
|
PRINTDB("Found resource folder '%s'", boosty::stringy(tmpdir).c_str());
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -67,7 +67,7 @@ RenderColorScheme::RenderColorScheme(fs::path path) : _path(path)
|
||||||
addColor(CGAL_EDGE_2D_COLOR, "cgal-edge-2d");
|
addColor(CGAL_EDGE_2D_COLOR, "cgal-edge-2d");
|
||||||
addColor(CROSSHAIR_COLOR, "crosshair");
|
addColor(CROSSHAIR_COLOR, "crosshair");
|
||||||
} catch (const std::exception & e) {
|
} catch (const std::exception & e) {
|
||||||
PRINTB("Error reading color scheme file '%s': %s", path.c_str() % e.what());
|
PRINTB("Error reading color scheme file '%s': %s", boosty::stringy(path).c_str() % e.what());
|
||||||
_error = e.what();
|
_error = e.what();
|
||||||
_name = "";
|
_name = "";
|
||||||
_index = 0;
|
_index = 0;
|
||||||
|
@ -261,7 +261,7 @@ void ColorMap::enumerateColorSchemesInPath(colorscheme_set_t &result_set, const
|
||||||
{
|
{
|
||||||
const fs::path color_schemes = basePath / "color-schemes" / "render";
|
const fs::path color_schemes = basePath / "color-schemes" / "render";
|
||||||
|
|
||||||
PRINTDB("Enumerating color schemes from '%s'", color_schemes.string().c_str());
|
PRINTDB("Enumerating color schemes from '%s'", boosty::stringy(color_schemes).c_str());
|
||||||
|
|
||||||
fs::directory_iterator end_iter;
|
fs::directory_iterator end_iter;
|
||||||
|
|
||||||
|
@ -272,7 +272,7 @@ void ColorMap::enumerateColorSchemesInPath(colorscheme_set_t &result_set, const
|
||||||
}
|
}
|
||||||
|
|
||||||
const fs::path path = (*dir_iter).path();
|
const fs::path path = (*dir_iter).path();
|
||||||
if (!(path.extension().string() == ".json")) {
|
if (!(path.extension() == ".json")) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -76,7 +76,7 @@ EditorColorScheme::EditorColorScheme(fs::path path) : path(path)
|
||||||
_name = QString(pt.get<std::string>("name").c_str());
|
_name = QString(pt.get<std::string>("name").c_str());
|
||||||
_index = pt.get<int>("index");
|
_index = pt.get<int>("index");
|
||||||
} catch (const std::exception & e) {
|
} catch (const std::exception & e) {
|
||||||
PRINTB("Error reading color scheme file '%s': %s", path.c_str() % e.what());
|
PRINTB("Error reading color scheme file '%s': %s", boosty::stringy(path).c_str() % e.what());
|
||||||
_name = "";
|
_name = "";
|
||||||
_index = 0;
|
_index = 0;
|
||||||
}
|
}
|
||||||
|
@ -369,7 +369,7 @@ void ScintillaEditor::enumerateColorSchemesInPath(ScintillaEditor::colorscheme_s
|
||||||
}
|
}
|
||||||
|
|
||||||
const fs::path path = (*dir_iter).path();
|
const fs::path path = (*dir_iter).path();
|
||||||
if (!(path.extension().string() == ".json")) {
|
if (!(path.extension() == ".json")) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue