summaryrefslogtreecommitdiffstats
path: root/src/script/api/qscriptengine.cpp
diff options
context:
space:
mode:
authorOswald Buddenhagen <oswald.buddenhagen@nokia.com>2009-12-15 14:40:07 (GMT)
committerOswald Buddenhagen <oswald.buddenhagen@nokia.com>2009-12-15 14:40:07 (GMT)
commitd869ec981447bc6d590954a939f18b5d37ebb6cd (patch)
treeb2b0bf2ccd1f5d886340475b70c9a91b2e456ebd /src/script/api/qscriptengine.cpp
parent2ba459c2adcaa4d0f865956048ac2e24f3fe6924 (diff)
parent0b402f10a26115332ae72bbf263fd15c8354ecb9 (diff)
downloadQt-d869ec981447bc6d590954a939f18b5d37ebb6cd.zip
Qt-d869ec981447bc6d590954a939f18b5d37ebb6cd.tar.gz
Qt-d869ec981447bc6d590954a939f18b5d37ebb6cd.tar.bz2
Merge remote branch 'mainline/4.6' into 4.6
Diffstat (limited to 'src/script/api/qscriptengine.cpp')
-rw-r--r--src/script/api/qscriptengine.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/script/api/qscriptengine.cpp b/src/script/api/qscriptengine.cpp
index b6aa872..1879367 100644
--- a/src/script/api/qscriptengine.cpp
+++ b/src/script/api/qscriptengine.cpp
@@ -33,6 +33,7 @@
#include "qscriptvalue_p.h"
#include "qscriptvalueiterator.h"
#include "qscriptclass.h"
+#include "qscriptcontextinfo.h"
#include "qscriptprogram.h"
#include "qscriptprogram_p.h"
#include "qdebug.h"
@@ -698,9 +699,9 @@ JSC::JSValue JSC_HOST_CALL functionQsTr(JSC::ExecState *exec, JSC::JSObject*, JS
return JSC::throwError(exec, JSC::GeneralError, "qsTranslate(): third argument (n) must be a number");
#ifndef QT_NO_QOBJECT
QString context;
-// ### implement context resolution
-// if (ctx->parentContext())
-// context = QFileInfo(ctx->parentContext()->fileName()).baseName();
+ QScriptContext *ctx = QScriptEnginePrivate::contextForFrame(exec);
+ if (ctx && ctx->parentContext())
+ context = QFileInfo(QScriptContextInfo(ctx->parentContext()).fileName()).baseName();
#endif
QString text(args.at(0).toString(exec));
#ifndef QT_NO_QOBJECT