summaryrefslogtreecommitdiff
path: root/tests/echotest.cc
diff options
context:
space:
mode:
authorMarius Kintel <marius@kintel.net>2011-12-24 23:22:03 (GMT)
committerMarius Kintel <marius@kintel.net>2011-12-24 23:22:03 (GMT)
commit9293b591c720d2021be15b3bed56633d2ac17a8d (patch)
treecc1d05a3b9f6599f6bc2168fbfe8a78f2f6711d2 /tests/echotest.cc
parenta5ea98c4a499bdc534d58ecf4881d6ce435d3bd5 (diff)
Ported currentdir handling from Qt to boost filesystem
Diffstat (limited to 'tests/echotest.cc')
-rw-r--r--tests/echotest.cc17
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);
contact: Jan Huwald // Impressum