summaryrefslogtreecommitdiffstats
path: root/src/script/api/qscriptengine.cpp
diff options
context:
space:
mode:
authorOlivier Goffart <ogoffart@trolltech.com>2009-12-14 17:46:49 (GMT)
committerOlivier Goffart <ogoffart@trolltech.com>2009-12-14 17:46:49 (GMT)
commit36949134f109c72b8aba174ebf4d618f91a9f7ce (patch)
tree82242eeb9a5c4b822575cd358d2ae81e15bed53e /src/script/api/qscriptengine.cpp
parent74bec871abb48baadf239fd12e77bb85924436a1 (diff)
parent463cd4f6563dc12d8b45bf2e293dc64d583e132c (diff)
downloadQt-36949134f109c72b8aba174ebf4d618f91a9f7ce.zip
Qt-36949134f109c72b8aba174ebf4d618f91a9f7ce.tar.gz
Qt-36949134f109c72b8aba174ebf4d618f91a9f7ce.tar.bz2
Merge commit 'origin/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