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()
|
||||
{
|
||||
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__
|
||||
const char *searchpath[] = {
|
||||
|
@ -57,11 +57,11 @@ static std::string lookupResourcesPath()
|
|||
tmpdir = resourcedir / searchpath[a];
|
||||
|
||||
const fs::path checkdir = tmpdir / "libraries";
|
||||
PRINTDB("Checking '%s'", checkdir.c_str());
|
||||
PRINTDB("Checking '%s'", boosty::stringy(checkdir).c_str());
|
||||
|
||||
if (is_directory(checkdir)) {
|
||||
resourcedir = tmpdir;
|
||||
PRINTDB("Found resource folder '%s'", tmpdir.c_str());
|
||||
PRINTDB("Found resource folder '%s'", boosty::stringy(tmpdir).c_str());
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -67,7 +67,7 @@ RenderColorScheme::RenderColorScheme(fs::path path) : _path(path)
|
|||
addColor(CGAL_EDGE_2D_COLOR, "cgal-edge-2d");
|
||||
addColor(CROSSHAIR_COLOR, "crosshair");
|
||||
} 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();
|
||||
_name = "";
|
||||
_index = 0;
|
||||
|
@ -261,7 +261,7 @@ void ColorMap::enumerateColorSchemesInPath(colorscheme_set_t &result_set, const
|
|||
{
|
||||
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;
|
||||
|
||||
|
@ -272,7 +272,7 @@ void ColorMap::enumerateColorSchemesInPath(colorscheme_set_t &result_set, const
|
|||
}
|
||||
|
||||
const fs::path path = (*dir_iter).path();
|
||||
if (!(path.extension().string() == ".json")) {
|
||||
if (!(path.extension() == ".json")) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
|
|
@ -76,7 +76,7 @@ EditorColorScheme::EditorColorScheme(fs::path path) : path(path)
|
|||
_name = QString(pt.get<std::string>("name").c_str());
|
||||
_index = pt.get<int>("index");
|
||||
} 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 = "";
|
||||
_index = 0;
|
||||
}
|
||||
|
@ -369,7 +369,7 @@ void ScintillaEditor::enumerateColorSchemesInPath(ScintillaEditor::colorscheme_s
|
|||
}
|
||||
|
||||
const fs::path path = (*dir_iter).path();
|
||||
if (!(path.extension().string() == ".json")) {
|
||||
if (!(path.extension() == ".json")) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue