summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBea Lam <bea.lam@nokia.com>2010-02-24 00:22:00 (GMT)
committerBea Lam <bea.lam@nokia.com>2010-02-24 00:22:00 (GMT)
commitad80aa026a4626d4c099a8842689ae203f5571e8 (patch)
tree4c6849e8242da1931c0f09fd49a55b4465acc5a1
parent206b55e618945e7cfb428cfa7a7decbb3dc9f2e4 (diff)
downloadQt-ad80aa026a4626d4c099a8842689ae203f5571e8.zip
Qt-ad80aa026a4626d4c099a8842689ae203f5571e8.tar.gz
Qt-ad80aa026a4626d4c099a8842689ae203f5571e8.tar.bz2
Disallow ids that start with upper case letters.
Task-number: QT-2786
-rw-r--r--src/declarative/qml/qmlcompiler.cpp5
-rw-r--r--tests/auto/declarative/qmllanguage/tst_qmllanguage.cpp2
2 files changed, 3 insertions, 4 deletions
diff --git a/src/declarative/qml/qmlcompiler.cpp b/src/declarative/qml/qmlcompiler.cpp
index 4365b17..3702d0b 100644
--- a/src/declarative/qml/qmlcompiler.cpp
+++ b/src/declarative/qml/qmlcompiler.cpp
@@ -123,10 +123,9 @@ bool QmlCompiler::isValidId(const QString &val)
if (val.isEmpty())
return false;
- // TODO this will be enforced and return false
if (val.at(0).isLetter() && !val.at(0).isLower()) {
- //return false;
- qWarning().nospace() << "id '" << val << "' is invalid: ids cannot start with uppercase letters. This will be enforced in an upcoming version of QML.";
+ qWarning().nospace() << "id " << val << " is invalid: ids cannot start with uppercase letters";
+ return false;
}
QChar u(QLatin1Char('_'));
diff --git a/tests/auto/declarative/qmllanguage/tst_qmllanguage.cpp b/tests/auto/declarative/qmllanguage/tst_qmllanguage.cpp
index 4090e1d..4d27e32 100644
--- a/tests/auto/declarative/qmllanguage/tst_qmllanguage.cpp
+++ b/tests/auto/declarative/qmllanguage/tst_qmllanguage.cpp
@@ -326,7 +326,7 @@ void tst_qmllanguage::errors()
QFETCH(bool, create);
if (file == "invalidID.6.qml")
- QSKIP("Test disabled until we strictly disallow ids from beginning with uppercase letters", SkipSingle);
+ QTest::ignoreMessage(QtWarningMsg, "id \"StartsWithUpperCase\" is invalid: ids cannot start with uppercase letters");
QmlComponent component(&engine, TEST_FILE(file));