summaryrefslogtreecommitdiffstats
path: root/src/script
diff options
context:
space:
mode:
authorTasuku Suzuki <tasuku.suzuki@nokia.com>2011-03-21 14:13:16 (GMT)
committerOswald Buddenhagen <oswald.buddenhagen@nokia.com>2011-03-21 14:13:16 (GMT)
commit84a342eea111f0a1da8fd0c417362aae2b851e56 (patch)
tree9ca77440d6503412408b5111d293dea088b8ffda /src/script
parent55650943492ff00d086bc76039212ce8438ee203 (diff)
downloadQt-84a342eea111f0a1da8fd0c417362aae2b851e56.zip
Qt-84a342eea111f0a1da8fd0c417362aae2b851e56.tar.gz
Qt-84a342eea111f0a1da8fd0c417362aae2b851e56.tar.bz2
Fix compilation with QT_NO_
Merge-request: 1132 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
Diffstat (limited to 'src/script')
-rw-r--r--src/script/api/qscriptengine.cpp6
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));
}