diff options
author | Don Bright <hugh.m.bright@gmail.com> | 2013-05-26 03:37:26 (GMT) |
---|---|---|
committer | Don Bright <hugh.m.bright@gmail.com> | 2013-05-26 03:37:26 (GMT) |
commit | 31c88a434b3201d88819b485f74da843c2728cb2 (patch) | |
tree | 6fc7bffe22a7b685aa2cf18143796ace29d4fb8b /src | |
parent | 164902fa76efac9f88bbd9aa6cbd1eb8c3fa00fb (diff) |
merge branch to get windows "library path" working. tweak build system,
eliminate several compiler warnings.
Diffstat (limited to 'src')
-rw-r--r-- | src/CGALEvaluator.cc | 1 | ||||
-rw-r--r-- | src/PlatformUtils.cc | 23 | ||||
-rw-r--r-- | src/cgaladv.cc | 1 | ||||
-rw-r--r-- | src/control.cc | 2 | ||||
-rw-r--r-- | src/csgops.cc | 1 | ||||
-rw-r--r-- | src/import.cc | 2 | ||||
-rw-r--r-- | src/mainwin.cc | 4 | ||||
-rw-r--r-- | src/system-gl.cc | 3 |
8 files changed, 32 insertions, 5 deletions
diff --git a/src/CGALEvaluator.cc b/src/CGALEvaluator.cc index d0140fa..2ea7a8d 100644 --- a/src/CGALEvaluator.cc +++ b/src/CGALEvaluator.cc @@ -291,6 +291,7 @@ Response CGALEvaluator::visit(State &state, const CsgNode &node) op = CGE_INTERSECTION; break; default: + op = -1; assert(false); } N = applyToChildren(node, op); diff --git a/src/PlatformUtils.cc b/src/PlatformUtils.cc index cea449b..a7efe40 100644 --- a/src/PlatformUtils.cc +++ b/src/PlatformUtils.cc @@ -3,5 +3,26 @@ std::string PlatformUtils::libraryPath() { - return boosty::stringy(fs::path(PlatformUtils::documentsPath()) / "OpenSCAD" / "libraries"); + fs::path path; + bool OK = true; + try { + path = boosty::canonical(fs::path(PlatformUtils::documentsPath())); + if (path.empty()) return ""; + PRINTB("path size %i",boosty::stringy(path).size()); + path /= "OpenSCAD"; + path /= "libraries"; + PRINTB("Appended path %s", path ); + PRINTB("Exists: %i", fs::exists(path) ); + if (!fs::exists(path)) { + PRINTB("Creating library folder %s", boosty::stringy(path) ); + OK &= fs::create_directories( path ); + } + if (!OK) { + PRINTB("ERROR: Cannot find nor create %s", boosty::stringy(path) ); + path = fs::path(""); + } + } catch (const fs::filesystem_error& ex) { + PRINTB("ERROR: %s",ex.what()); + } + return boosty::stringy( path ); } diff --git a/src/cgaladv.cc b/src/cgaladv.cc index 70590f7..ee3d657 100644 --- a/src/cgaladv.cc +++ b/src/cgaladv.cc @@ -142,6 +142,7 @@ std::string CgaladvNode::name() const default: assert(false); } + return "internal_error"; } std::string CgaladvNode::toString() const diff --git a/src/control.cc b/src/control.cc index 7786e36..c5ad09b 100644 --- a/src/control.cc +++ b/src/control.cc @@ -114,7 +114,7 @@ AbstractNode *ControlModule::instantiate(const Context *ctx, const ModuleInstant // assert(filectx->evalctx); if (filectx->evalctx) { - if (n < filectx->evalctx->numChildren()) { + if (n < (int)filectx->evalctx->numChildren()) { node = filectx->evalctx->getChild(n)->evaluate(filectx->evalctx); } else { diff --git a/src/csgops.cc b/src/csgops.cc index 92b97e7..8ac1d4f 100644 --- a/src/csgops.cc +++ b/src/csgops.cc @@ -69,6 +69,7 @@ std::string CsgNode::name() const default: assert(false); } + return "internal_error"; } void register_builtin_csgops() diff --git a/src/import.cc b/src/import.cc index 2180684..b5d67d2 100644 --- a/src/import.cc +++ b/src/import.cc @@ -204,7 +204,7 @@ PolySet *ImportNode::evaluate_polyset(class PolySetEvaluator *) const boost::regex ex_vertices("\\s*vertex\\s+([^\\s]+)\\s+([^\\s]+)\\s+([^\\s]+)"); bool binary = false; - int file_size = f.tellg(); + std::streampos file_size = f.tellg(); f.seekg(80); if (!f.eof()) { uint32_t facenum = 0; diff --git a/src/mainwin.cc b/src/mainwin.cc index 9b490c7..f370f3d 100644 --- a/src/mainwin.cc +++ b/src/mainwin.cc @@ -955,7 +955,9 @@ void MainWindow::actionSaveAs() void MainWindow::actionShowLibraryFolder() { - QDesktopServices::openUrl(QUrl::fromLocalFile(QString::fromStdString(PlatformUtils::libraryPath()))); + QString url = QString::fromStdString(PlatformUtils::libraryPath()); + PRINTB("Opening file browser for %s", url.toStdString() ); + QDesktopServices::openUrl(QUrl::fromLocalFile( url )); } void MainWindow::actionReload() diff --git a/src/system-gl.cc b/src/system-gl.cc index 0c436e5..098dcb2 100644 --- a/src/system-gl.cc +++ b/src/system-gl.cc @@ -46,7 +46,8 @@ string glew_extensions_dump() sort( extensions.begin(), extensions.end() ); stringstream out; out << "GL Extensions:"; - for ( int i=0;i<extensions.size();i++ ) out << extensions[i] << "\n"; + for ( unsigned int i=0;i<extensions.size();i++ ) + out << extensions[i] << "\n"; return out.str(); } |