summaryrefslogtreecommitdiffstats
path: root/src/declarative/qml/qmlcompiler.cpp
diff options
context:
space:
mode:
authorAaron Kennedy <aaron.kennedy@nokia.com>2009-10-12 03:00:08 (GMT)
committerAaron Kennedy <aaron.kennedy@nokia.com>2009-10-12 03:00:08 (GMT)
commit6be94173f3f209d785e5787df8440d20ff0f2709 (patch)
tree75794282e09b2af08b26752069b0eb7fcabe3653 /src/declarative/qml/qmlcompiler.cpp
parent68c69f88d4c3a7b9f24162a4c7708ded7caba90e (diff)
downloadQt-6be94173f3f209d785e5787df8440d20ff0f2709.zip
Qt-6be94173f3f209d785e5787df8440d20ff0f2709.tar.gz
Qt-6be94173f3f209d785e5787df8440d20ff0f2709.tar.bz2
Use utf8 instead of latin1 where appropriate
Diffstat (limited to 'src/declarative/qml/qmlcompiler.cpp')
-rw-r--r--src/declarative/qml/qmlcompiler.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/declarative/qml/qmlcompiler.cpp b/src/declarative/qml/qmlcompiler.cpp
index f33731c..48d3360 100644
--- a/src/declarative/qml/qmlcompiler.cpp
+++ b/src/declarative/qml/qmlcompiler.cpp
@@ -195,14 +195,14 @@ bool QmlCompiler::testLiteralAssignment(const QMetaProperty &prop,
QString string = v->value.asScript();
if (!prop.isWritable())
- COMPILE_EXCEPTION(v, "Invalid property assignment:" << QLatin1String(prop.name()) << "is a read-only property");
+ COMPILE_EXCEPTION(v, "Invalid property assignment:" << QString::fromUtf8(prop.name()) << "is a read-only property");
if (prop.isEnumType()) {
int value;
if (prop.isFlagType()) {
- value = prop.enumerator().keysToValue(string.toLatin1().constData());
+ value = prop.enumerator().keysToValue(string.toUtf8().constData());
} else
- value = prop.enumerator().keyToValue(string.toLatin1().constData());
+ value = prop.enumerator().keyToValue(string.toUtf8().constData());
if (value == -1)
COMPILE_EXCEPTION(v, "Invalid property assignment: unknown enumeration");
return true;
@@ -336,9 +336,9 @@ void QmlCompiler::genLiteralAssignment(const QMetaProperty &prop,
if (prop.isEnumType()) {
int value;
if (prop.isFlagType()) {
- value = prop.enumerator().keysToValue(string.toLatin1().constData());
+ value = prop.enumerator().keysToValue(string.toUtf8().constData());
} else
- value = prop.enumerator().keyToValue(string.toLatin1().constData());
+ value = prop.enumerator().keyToValue(string.toUtf8().constData());
instr.type = QmlInstruction::StoreInteger;
instr.storeInteger.propertyIndex = prop.propertyIndex();
@@ -595,7 +595,7 @@ bool QmlCompiler::compile(QmlEngine *engine,
ref.ref = tref.unit;
ref.ref->addref();
}
- ref.className = parserRef->name.toLatin1();
+ ref.className = parserRef->name.toUtf8();
out->types << ref;
}
@@ -2520,7 +2520,7 @@ QStringList QmlCompiler::deferredProperties(QmlParser::Object *obj)
return QStringList();
QMetaClassInfo classInfo = mo->classInfo(idx);
- QStringList rv = QString(QLatin1String(classInfo.value())).split(QLatin1Char(','));
+ QStringList rv = QString::fromUtf8(classInfo.value()).split(QLatin1Char(','));
return rv;
}