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/csgtermtest.cc | |
parent | a5ea98c4a499bdc534d58ecf4881d6ce435d3bd5 (diff) |
Ported currentdir handling from Qt to boost filesystem
Diffstat (limited to 'tests/csgtermtest.cc')
-rw-r--r-- | tests/csgtermtest.cc | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/tests/csgtermtest.cc b/tests/csgtermtest.cc index 52e55c4..7fae3fb 100644 --- a/tests/csgtermtest.cc +++ b/tests/csgtermtest.cc @@ -39,9 +39,6 @@ #include "csgterm.h" #include <QApplication> -#include <QFile> -#include <QDir> -#include <QSet> #ifndef _MSC_VER #include <getopt.h> #endif @@ -50,12 +47,15 @@ #include <sstream> #include <fstream> -using std::cout; +#include <boost/filesystem.hpp> +namespace fs = boost::filesystem; std::string commandline_commands; -QString currentdir; +std::string currentdir; QString examplesdir; +using std::cout; + int main(int argc, char **argv) { if (argc != 3) { @@ -71,9 +71,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(); @@ -89,8 +89,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); @@ -115,7 +114,7 @@ int main(int argc, char **argv) // if (evaluator.background) cout << "Background terms: " << evaluator.background->size() << "\n"; // if (evaluator.highlights) cout << "Highlights terms: " << evaluator.highlights->size() << "\n"; - QDir::setCurrent(original_path.absolutePath()); + current_path(original_path); std::ofstream outfile; outfile.open(outfilename); if (root_term) { |