summaryrefslogtreecommitdiff
path: root/src/context.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/context.cc')
-rw-r--r--src/context.cc8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/context.cc b/src/context.cc
index 8c84374..a9ccc98 100644
--- a/src/context.cc
+++ b/src/context.cc
@@ -28,6 +28,8 @@
#include "function.h"
#include "module.h"
#include "printutils.h"
+#include <QFileInfo>
+#include <QDir>
Context::Context(const Context *parent)
{
@@ -35,6 +37,7 @@ Context::Context(const Context *parent)
functions_p = NULL;
modules_p = NULL;
inst_p = NULL;
+ if (parent) document_path = parent->document_path;
ctx_stack.append(this);
}
@@ -109,3 +112,8 @@ AbstractNode *Context::evaluate_module(const ModuleInstantiation *inst) const
return NULL;
}
+QString Context::get_absolute_path(const QString &filename) const
+{
+ return QFileInfo(QDir(this->document_path), filename).absoluteFilePath();
+}
+
contact: Jan Huwald // Impressum