summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Huwald <jh@sotun.de>2014-02-14 12:46:23 (GMT)
committerJan Huwald <jh@sotun.de>2014-02-14 12:46:23 (GMT)
commit59c467ca01619194f391d4abe033909a72b86349 (patch)
treea7f8d21c8fd752f67272840c767e69ea7202e9dc
parentc3805a9ff5b18eb9e3398f85f69a800e6d289068 (diff)
compute application path without resorting to Qt
cmdline() determines the application path using either Qt or boost::filesystem, depending on wether Qt is enabled. With this patch we always use boost:filesystem.
-rw-r--r--src/openscad.cc12
1 files changed, 4 insertions, 8 deletions
diff --git a/src/openscad.cc b/src/openscad.cc
index 59c9b93..96c2c0f 100644
--- a/src/openscad.cc
+++ b/src/openscad.cc
@@ -188,14 +188,10 @@ Camera get_camera( po::variables_map vm )
return camera;
}
-int cmdline(const char *deps_output_file, const std::string &filename, Camera &camera, const char *output_file, const fs::path &original_path, Render::type renderer, int argc, char ** argv )
+int cmdline(const char *deps_output_file, const std::string &filename, Camera &camera, const char *output_file, const fs::path &original_path, Render::type renderer, std::string application_name)
{
-#ifdef OPENSCAD_QTGUI
- QCoreApplication app(argc, argv);
- const std::string application_path = QApplication::instance()->applicationDirPath().toLocal8Bit().constData();
-#else
- const std::string application_path = boosty::stringy(boosty::absolute(boost::filesystem::path(argv[0]).parent_path()));
-#endif
+ const std::string application_path = boosty::stringy(boosty::absolute(boost::filesystem::path(application_name).parent_path()));
+
parser_init(application_path);
Tree tree;
#ifdef ENABLE_CGAL
@@ -702,7 +698,7 @@ int main(int argc, char **argv)
}
if (cmdlinemode) {
- rc = cmdline(deps_output_file, inputFiles[0], camera, output_file, original_path, renderer, argc, argv);
+ rc = cmdline(deps_output_file, inputFiles[0], camera, output_file, original_path, renderer, argv[0]);
}
else if (QtUseGUI()) {
rc = gui(inputFiles, original_path, argc, argv);
contact: Jan Huwald // Impressum