summaryrefslogtreecommitdiffstats
path: root/src/declarative/qml/qdeclarativecompiler.cpp
diff options
context:
space:
mode:
authorDmytro Poplavskiy <dmytro.poplavskiy@nokia.com>2010-03-09 00:58:23 (GMT)
committerDmytro Poplavskiy <dmytro.poplavskiy@nokia.com>2010-03-09 00:58:23 (GMT)
commita4ffe2d274cae2510d72d04f67b42f9448282fbd (patch)
tree73bc2d655e4f9d449ff51671ecd50f76a929374c /src/declarative/qml/qdeclarativecompiler.cpp
parent7a5cc73816df5cf65e8a9aaafd750acdac9ca5a3 (diff)
parent86354a3896b92b110e5d28cbf894c23ed837f11e (diff)
downloadQt-a4ffe2d274cae2510d72d04f67b42f9448282fbd.zip
Qt-a4ffe2d274cae2510d72d04f67b42f9448282fbd.tar.gz
Qt-a4ffe2d274cae2510d72d04f67b42f9448282fbd.tar.bz2
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/qt-multimedia-staging into 4.7
Diffstat (limited to 'src/declarative/qml/qdeclarativecompiler.cpp')
-rw-r--r--src/declarative/qml/qdeclarativecompiler.cpp12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/declarative/qml/qdeclarativecompiler.cpp b/src/declarative/qml/qdeclarativecompiler.cpp
index 5a2f3b5..ef1032b 100644
--- a/src/declarative/qml/qdeclarativecompiler.cpp
+++ b/src/declarative/qml/qdeclarativecompiler.cpp
@@ -561,9 +561,11 @@ bool QDeclarativeCompiler::compile(QDeclarativeEngine *engine,
QDeclarativeCompositeTypeData::TypeReference &tref = unit->types[ii];
QDeclarativeCompiledData::TypeReference ref;
QDeclarativeScriptParser::TypeReference *parserRef = unit->data.referencedTypes().at(ii);
- if (tref.type)
+ if (tref.type) {
ref.type = tref.type;
- else if (tref.unit) {
+ if (!ref.type->isCreatable())
+ COMPILE_EXCEPTION(parserRef->refObjects.first(), QCoreApplication::translate("QDeclarativeCompiler", "Element is not creatable."));
+ } else if (tref.unit) {
ref.component = tref.unit->toComponent(engine);
if (ref.component->isError()) {
@@ -2202,6 +2204,8 @@ bool QDeclarativeCompiler::checkDynamicMeta(QDeclarativeParser::Object *obj)
if (propNames.contains(prop.name))
COMPILE_EXCEPTION(&prop, QCoreApplication::translate("QDeclarativeCompiler","Duplicate property name"));
+ if (QString::fromUtf8(prop.name).at(0).isUpper())
+ COMPILE_EXCEPTION(&prop, QCoreApplication::translate("QDeclarativeCompiler","Property names cannot begin with an upper case letter"));
propNames.insert(prop.name);
}
@@ -2209,12 +2213,16 @@ bool QDeclarativeCompiler::checkDynamicMeta(QDeclarativeParser::Object *obj)
QByteArray name = obj->dynamicSignals.at(ii).name;
if (methodNames.contains(name))
COMPILE_EXCEPTION(obj, QCoreApplication::translate("QDeclarativeCompiler","Duplicate signal name"));
+ if (QString::fromUtf8(name).at(0).isUpper())
+ COMPILE_EXCEPTION(obj, QCoreApplication::translate("QDeclarativeCompiler","Signal names cannot begin with an upper case letter"));
methodNames.insert(name);
}
for (int ii = 0; ii < obj->dynamicSlots.count(); ++ii) {
QByteArray name = obj->dynamicSlots.at(ii).name;
if (methodNames.contains(name))
COMPILE_EXCEPTION(obj, QCoreApplication::translate("QDeclarativeCompiler","Duplicate method name"));
+ if (QString::fromUtf8(name).at(0).isUpper())
+ COMPILE_EXCEPTION(obj, QCoreApplication::translate("QDeclarativeCompiler","Method names cannot begin with an upper case letter"));
methodNames.insert(name);
}