diff options
author | Marius Kintel <marius@kintel.net> | 2011-12-24 23:22:03 (GMT) |
---|---|---|
committer | Marius Kintel <marius@kintel.net> | 2011-12-24 23:22:03 (GMT) |
commit | 9293b591c720d2021be15b3bed56633d2ac17a8d (patch) | |
tree | cc1d05a3b9f6599f6bc2168fbfe8a78f2f6711d2 /tests/csgtexttest.cc | |
parent | a5ea98c4a499bdc534d58ecf4881d6ce435d3bd5 (diff) |
Ported currentdir handling from Qt to boost filesystem
Diffstat (limited to 'tests/csgtexttest.cc')
-rw-r--r-- | tests/csgtexttest.cc | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/tests/csgtexttest.cc b/tests/csgtexttest.cc index 2c54ed4..d0d27ce 100644 --- a/tests/csgtexttest.cc +++ b/tests/csgtexttest.cc @@ -38,9 +38,6 @@ #include "Tree.h" #include <QApplication> -#include <QFile> -#include <QDir> -#include <QSet> #ifndef _MSC_VER #include <getopt.h> #endif @@ -49,8 +46,11 @@ #include <sstream> #include <fstream> +#include <boost/filesystem.hpp> +namespace fs = boost::filesystem; + std::string commandline_commands; -QString currentdir; +std::string currentdir; QString examplesdir; void csgTree(CSGTextCache &cache, const AbstractNode &root) @@ -75,9 +75,9 @@ int main(int argc, char **argv) Builtins::instance()->initialize(); QApplication app(argc, argv, false); - QDir original_path = QDir::current(); + fs::path original_path = fs::current_path(); - currentdir = QDir::currentPath(); + currentdir = fs::current_path().generic_string(); parser_init(); @@ -93,8 +93,7 @@ int main(int argc, char **argv) exit(1); } - QFileInfo fileInfo(filename); - QDir::setCurrent(fileInfo.absolutePath()); + fs::current_path(fs::path(filename).parent_path()); AbstractNode::resetIndexCounter(); root_node = root_module->evaluate(&root_ctx, &root_inst); @@ -106,7 +105,7 @@ int main(int argc, char **argv) csgTree(csgcache, *root_node); // std::cout << tree.getString(*root_node) << "\n"; - QDir::setCurrent(original_path.absolutePath()); + current_path(original_path); std::ofstream outfile; outfile.open(outfilename); outfile << csgcache[*root_node] << "\n"; |