diff options
author | Guoqing Zhang <guoqing.zhang@nokia.com> | 2011-04-05 11:29:44 (GMT) |
---|---|---|
committer | Guoqing Zhang <guoqing.zhang@nokia.com> | 2011-04-05 11:29:44 (GMT) |
commit | bb5bf52e3d8660ee15aec9e959730e265b81eda4 (patch) | |
tree | 548df7f6c522ae077d6b3313456042b3e3922a4c /src/script/api/qscriptengine.cpp | |
parent | 8a72b97df7cec679a82d6aa93307350fe03cc145 (diff) | |
parent | c3e903409b96fede96cb4a7b95ba308663c88879 (diff) | |
download | Qt-bb5bf52e3d8660ee15aec9e959730e265b81eda4.zip Qt-bb5bf52e3d8660ee15aec9e959730e265b81eda4.tar.gz Qt-bb5bf52e3d8660ee15aec9e959730e265b81eda4.tar.bz2 |
Merge remote branch 'qt-master/master'
Diffstat (limited to 'src/script/api/qscriptengine.cpp')
-rw-r--r-- | src/script/api/qscriptengine.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/script/api/qscriptengine.cpp b/src/script/api/qscriptengine.cpp index ceb1b03..a3a965e 100644 --- a/src/script/api/qscriptengine.cpp +++ b/src/script/api/qscriptengine.cpp @@ -779,6 +779,8 @@ JSC::JSValue JSC_HOST_CALL functionVersion(JSC::ExecState *exec, JSC::JSObject*, return JSC::JSValue(exec, 1); } +#ifndef QT_NO_TRANSLATION + static JSC::JSValue JSC_HOST_CALL functionQsTranslate(JSC::ExecState*, JSC::JSObject*, JSC::JSValue, const JSC::ArgList&); static JSC::JSValue JSC_HOST_CALL functionQsTranslateNoOp(JSC::ExecState*, JSC::JSObject*, JSC::JSValue, const JSC::ArgList&); static JSC::JSValue JSC_HOST_CALL functionQsTr(JSC::ExecState*, JSC::JSObject*, JSC::JSValue, const JSC::ArgList&); @@ -917,6 +919,7 @@ JSC::JSValue JSC_HOST_CALL functionQsTrIdNoOp(JSC::ExecState *, JSC::JSObject*, return JSC::jsUndefined(); return args.at(0); } +#endif // QT_NO_TRANSLATION static JSC::JSValue JSC_HOST_CALL stringProtoFuncArg(JSC::ExecState*, JSC::JSObject*, JSC::JSValue, const JSC::ArgList&); @@ -3486,12 +3489,15 @@ void QScriptEngine::installTranslatorFunctions(const QScriptValue &object) if (!jscObject || !jscObject.isObject()) jscObject = d->globalObject(); // unsigned attribs = JSC::DontEnum; + +#ifndef QT_NO_TRANSLATION JSC::asObject(jscObject)->putDirectFunction(exec, new (exec)JSC::NativeFunctionWrapper(exec, glob->prototypeFunctionStructure(), 5, JSC::Identifier(exec, "qsTranslate"), QScript::functionQsTranslate)); JSC::asObject(jscObject)->putDirectFunction(exec, new (exec)JSC::NativeFunctionWrapper(exec, glob->prototypeFunctionStructure(), 2, JSC::Identifier(exec, "QT_TRANSLATE_NOOP"), QScript::functionQsTranslateNoOp)); JSC::asObject(jscObject)->putDirectFunction(exec, new (exec)JSC::NativeFunctionWrapper(exec, glob->prototypeFunctionStructure(), 3, JSC::Identifier(exec, "qsTr"), QScript::functionQsTr)); JSC::asObject(jscObject)->putDirectFunction(exec, new (exec)JSC::NativeFunctionWrapper(exec, glob->prototypeFunctionStructure(), 1, JSC::Identifier(exec, "QT_TR_NOOP"), QScript::functionQsTrNoOp)); JSC::asObject(jscObject)->putDirectFunction(exec, new (exec)JSC::NativeFunctionWrapper(exec, glob->prototypeFunctionStructure(), 1, JSC::Identifier(exec, "qsTrId"), QScript::functionQsTrId)); JSC::asObject(jscObject)->putDirectFunction(exec, new (exec)JSC::NativeFunctionWrapper(exec, glob->prototypeFunctionStructure(), 1, JSC::Identifier(exec, "QT_TRID_NOOP"), QScript::functionQsTrIdNoOp)); +#endif glob->stringPrototype()->putDirectFunction(exec, new (exec)JSC::NativeFunctionWrapper(exec, glob->prototypeFunctionStructure(), 1, JSC::Identifier(exec, "arg"), QScript::stringProtoFuncArg)); } |