diff options
author | Qt Continuous Integration System <qt-info@nokia.com> | 2010-11-09 21:46:53 (GMT) |
---|---|---|
committer | Qt Continuous Integration System <qt-info@nokia.com> | 2010-11-09 21:46:53 (GMT) |
commit | d9daad0ec3e3220c778177bb17d67158bde9c5aa (patch) | |
tree | d466de2143d81f0a20c3203193a7f2371c1ef48e /src/script/api/qscriptengine.cpp | |
parent | 5b03f39a9dceac181abe304eb9be7647f6f166fb (diff) | |
parent | e1bcbc5bcf3d6015cacc717c31f96d2230890e88 (diff) | |
download | Qt-d9daad0ec3e3220c778177bb17d67158bde9c5aa.zip Qt-d9daad0ec3e3220c778177bb17d67158bde9c5aa.tar.gz Qt-d9daad0ec3e3220c778177bb17d67158bde9c5aa.tar.bz2 |
Merge branch 'master' of scm.dev.nokia.troll.no:qt/oslo-staging-1 into master-integration
* 'master' of scm.dev.nokia.troll.no:qt/oslo-staging-1:
Add autotests for setting non-Object as prototype value
Revert new flaky test
compile fix for namespaced Qt
Ensured that the document nodes are sorted in the generated index.
Make qsTr() work with Unicode (non-Latin-1) strings
Add autotest that checks return value of QScriptContext::throwXXX()
Improve autotest coverage of QScriptEngineDebugger
Add benchmark for emitting signals from QtScript
Split monolithic QtScript autotest into smaller tests
Diffstat (limited to 'src/script/api/qscriptengine.cpp')
-rw-r--r-- | src/script/api/qscriptengine.cpp | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/script/api/qscriptengine.cpp b/src/script/api/qscriptengine.cpp index 2d5e5f4..69abcad 100644 --- a/src/script/api/qscriptengine.cpp +++ b/src/script/api/qscriptengine.cpp @@ -808,7 +808,7 @@ JSC::JSValue JSC_HOST_CALL functionQsTranslate(JSC::ExecState *exec, JSC::JSObje JSC::UString comment; if (args.size() > 2) comment = args.at(2).toString(exec); - QCoreApplication::Encoding encoding = QCoreApplication::CodecForTr; + QCoreApplication::Encoding encoding = QCoreApplication::UnicodeUTF8; if (args.size() > 3) { JSC::UString encStr = args.at(3).toString(exec); if (encStr == "CodecForTr") @@ -824,9 +824,9 @@ JSC::JSValue JSC_HOST_CALL functionQsTranslate(JSC::ExecState *exec, JSC::JSObje #endif JSC::UString result; #ifndef QT_NO_QOBJECT - result = QCoreApplication::translate(QScript::convertToLatin1(context).constData(), - QScript::convertToLatin1(text).constData(), - QScript::convertToLatin1(comment).constData(), + result = QCoreApplication::translate(context.UTF8String().c_str(), + text.UTF8String().c_str(), + comment.UTF8String().c_str(), encoding, n); #else result = text; @@ -878,10 +878,10 @@ JSC::JSValue JSC_HOST_CALL functionQsTr(JSC::ExecState *exec, JSC::JSObject*, JS #endif JSC::UString result; #ifndef QT_NO_QOBJECT - result = QCoreApplication::translate(QScript::convertToLatin1(context).constData(), - QScript::convertToLatin1(text).constData(), - QScript::convertToLatin1(comment).constData(), - QCoreApplication::CodecForTr, n); + result = QCoreApplication::translate(context.UTF8String().c_str(), + text.UTF8String().c_str(), + comment.UTF8String().c_str(), + QCoreApplication::UnicodeUTF8, n); #else result = text; #endif @@ -907,7 +907,7 @@ JSC::JSValue JSC_HOST_CALL functionQsTrId(JSC::ExecState *exec, JSC::JSObject*, int n = -1; if (args.size() > 1) n = args.at(1).toInt32(exec); - return JSC::jsString(exec, qtTrId(QScript::convertToLatin1(id).constData(), n)); + return JSC::jsString(exec, qtTrId(id.UTF8String().c_str(), n)); } JSC::JSValue JSC_HOST_CALL functionQsTrIdNoOp(JSC::ExecState *, JSC::JSObject*, JSC::JSValue, const JSC::ArgList &args) |