summaryrefslogtreecommitdiffstats
path: root/src/script/api/qscriptengine.cpp
diff options
context:
space:
mode:
authorQt Continuous Integration System <qt-info@nokia.com>2010-03-01 19:26:04 (GMT)
committerQt Continuous Integration System <qt-info@nokia.com>2010-03-01 19:26:04 (GMT)
commit82991e40afd46f91de42dec048df705441b6b0cf (patch)
treef4127a385279cfbe5e560463827ab5a95d38daeb /src/script/api/qscriptengine.cpp
parent2d719ce634efa5e0abfb5d76eb516133753b5a62 (diff)
parentf2dd19b1ad656f18991b543b32c5eae9cfbc28d0 (diff)
downloadQt-82991e40afd46f91de42dec048df705441b6b0cf.zip
Qt-82991e40afd46f91de42dec048df705441b6b0cf.tar.gz
Qt-82991e40afd46f91de42dec048df705441b6b0cf.tar.bz2
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-1 into 4.7-integration
* '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-1: typo for windows ce exclusion rule Updated .gitignore with the new name of the qmlviewer Fixed the close button of the find widget in Assistant Doc: brief Qt Quick introduction on "What's New" page. Interview Demo: Fix warning about pixmap leak on X11. Perform latin1 conversion directly on JSC::UString Avoid conversion between JavaScriptCore String type and QString Doc: Rephrase documentation for QColor::isValidColor and add \since 4.7. Use QList::reserve() in QDataStream>>QList Added static method isValidColor to QColor. compile fix with namespaces build fix for WinCE qDetectCPUFeatures: compile fix with namespaces compile fix for WinCE Mac: using Qt to write plugins disables quit for 3rd party application doc: Fixed building documentation Updated syncqt to use relative include paths on cygwin as well.
Diffstat (limited to 'src/script/api/qscriptengine.cpp')
-rw-r--r--src/script/api/qscriptengine.cpp44
1 files changed, 22 insertions, 22 deletions
diff --git a/src/script/api/qscriptengine.cpp b/src/script/api/qscriptengine.cpp
index d2e96d1..9cd5c63 100644
--- a/src/script/api/qscriptengine.cpp
+++ b/src/script/api/qscriptengine.cpp
@@ -563,7 +563,7 @@ JSC::JSValue JSC_HOST_CALL functionDisconnect(JSC::ExecState *exec, JSC::JSObjec
slot = arg1;
else {
QScript::SaveFrameHelper saveFrame(engine, exec);
- QString propertyName(QScriptEnginePrivate::toString(exec, arg1));
+ JSC::UString propertyName = QScriptEnginePrivate::toString(exec, arg1);
slot = QScriptEnginePrivate::property(exec, arg0, propertyName, QScriptValue::ResolvePrototype);
}
}
@@ -645,7 +645,7 @@ JSC::JSValue JSC_HOST_CALL functionConnect(JSC::ExecState *exec, JSC::JSObject *
slot = arg1;
else {
QScript::SaveFrameHelper saveFrame(engine, exec);
- QString propertyName = QScriptEnginePrivate::toString(exec, arg1);
+ JSC::UString propertyName = QScriptEnginePrivate::toString(exec, arg1);
slot = QScriptEnginePrivate::property(exec, arg0, propertyName, QScriptValue::ResolvePrototype);
}
}
@@ -723,19 +723,19 @@ JSC::JSValue JSC_HOST_CALL functionQsTranslate(JSC::ExecState *exec, JSC::JSObje
if ((args.size() > 4) && !args.at(4).isNumber())
return JSC::throwError(exec, JSC::GeneralError, "qsTranslate(): fifth argument (n) must be a number");
#ifndef QT_NO_QOBJECT
- QString context(args.at(0).toString(exec));
+ JSC::UString context = args.at(0).toString(exec);
#endif
- QString text(args.at(1).toString(exec));
+ JSC::UString text = args.at(1).toString(exec);
#ifndef QT_NO_QOBJECT
- QString comment;
+ JSC::UString comment;
if (args.size() > 2)
comment = args.at(2).toString(exec);
QCoreApplication::Encoding encoding = QCoreApplication::CodecForTr;
if (args.size() > 3) {
- QString encStr(args.at(3).toString(exec));
- if (encStr == QLatin1String("CodecForTr"))
+ JSC::UString encStr = args.at(3).toString(exec);
+ if (encStr == "CodecForTr")
encoding = QCoreApplication::CodecForTr;
- else if (encStr == QLatin1String("UnicodeUTF8"))
+ else if (encStr == "UnicodeUTF8")
encoding = QCoreApplication::UnicodeUTF8;
else
return JSC::throwError(exec, JSC::GeneralError, QString::fromLatin1("qsTranslate(): invalid encoding '%s'").arg(encStr));
@@ -744,11 +744,11 @@ JSC::JSValue JSC_HOST_CALL functionQsTranslate(JSC::ExecState *exec, JSC::JSObje
if (args.size() > 4)
n = args.at(4).toInt32(exec);
#endif
- QString result;
+ JSC::UString result;
#ifndef QT_NO_QOBJECT
- result = QCoreApplication::translate(context.toLatin1().constData(),
- text.toLatin1().constData(),
- comment.toLatin1().constData(),
+ result = QCoreApplication::translate(QScript::convertToLatin1(context).constData(),
+ QScript::convertToLatin1(text).constData(),
+ QScript::convertToLatin1(comment).constData(),
encoding, n);
#else
result = text;
@@ -774,25 +774,25 @@ JSC::JSValue JSC_HOST_CALL functionQsTr(JSC::ExecState *exec, JSC::JSObject*, JS
if ((args.size() > 2) && !args.at(2).isNumber())
return JSC::throwError(exec, JSC::GeneralError, "qsTranslate(): third argument (n) must be a number");
#ifndef QT_NO_QOBJECT
- QString context;
+ JSC::UString context;
QScriptContext *ctx = QScriptEnginePrivate::contextForFrame(exec);
if (ctx && ctx->parentContext())
context = QFileInfo(QScriptContextInfo(ctx->parentContext()).fileName()).baseName();
#endif
- QString text(args.at(0).toString(exec));
+ JSC::UString text = args.at(0).toString(exec);
#ifndef QT_NO_QOBJECT
- QString comment;
+ JSC::UString comment;
if (args.size() > 1)
comment = args.at(1).toString(exec);
int n = -1;
if (args.size() > 2)
n = args.at(2).toInt32(exec);
#endif
- QString result;
+ JSC::UString result;
#ifndef QT_NO_QOBJECT
- result = QCoreApplication::translate(context.toLatin1().constData(),
- text.toLatin1().constData(),
- comment.toLatin1().constData(),
+ result = QCoreApplication::translate(QScript::convertToLatin1(context).constData(),
+ QScript::convertToLatin1(text).constData(),
+ QScript::convertToLatin1(comment).constData(),
QCoreApplication::CodecForTr, n);
#else
result = text;
@@ -1580,9 +1580,9 @@ QRegExp QScriptEnginePrivate::toRegExp(JSC::ExecState *exec, JSC::JSValue value)
{
if (!isRegExp(value))
return QRegExp();
- QString pattern = toString(exec, property(exec, value, QLatin1String("source"), QScriptValue::ResolvePrototype));
+ QString pattern = toString(exec, property(exec, value, "source", QScriptValue::ResolvePrototype));
Qt::CaseSensitivity kase = Qt::CaseSensitive;
- if (toBool(exec, property(exec, value, QLatin1String("ignoreCase"), QScriptValue::ResolvePrototype)))
+ if (toBool(exec, property(exec, value, "ignoreCase", QScriptValue::ResolvePrototype)))
kase = Qt::CaseInsensitive;
return QRegExp(pattern, kase, QRegExp::RegExp2);
}
@@ -1637,7 +1637,7 @@ JSC::JSValue QScriptEnginePrivate::propertyHelper(JSC::ExecState *exec, JSC::JSV
}
if (!result && (resolveMode & QScriptValue::ResolveScope)) {
// ### check if it's a function object and look in the scope chain
- JSC::JSValue scope = property(exec, value, QString::fromLatin1("__qt_scope__"), QScriptValue::ResolveLocal);
+ JSC::JSValue scope = property(exec, value, "__qt_scope__", QScriptValue::ResolveLocal);
if (isObject(scope))
result = property(exec, scope, id, resolveMode);
}