diff options
Diffstat (limited to 'tests/echotest.cc')
-rw-r--r-- | tests/echotest.cc | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/tests/echotest.cc b/tests/echotest.cc index 9569f09..7f05149 100644 --- a/tests/echotest.cc +++ b/tests/echotest.cc @@ -35,9 +35,6 @@ #include "printutils.h" #include <QApplication> -#include <QFile> -#include <QDir> -#include <QSet> #ifndef _MSC_VER #include <getopt.h> #endif @@ -46,12 +43,15 @@ #include <sstream> #include <fstream> -using std::string; +#include <boost/filesystem.hpp> +namespace fs = boost::filesystem; std::string commandline_commands; -QString currentdir; +std::string currentdir; QString examplesdir; +using std::string; + static void outfile_handler(const std::string &msg, void *userdata) { std::ostream *str = static_cast<std::ostream*>(userdata); *str << msg << std::endl; @@ -83,9 +83,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(); @@ -101,8 +101,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); |