From ad80aa026a4626d4c099a8842689ae203f5571e8 Mon Sep 17 00:00:00 2001 From: Bea Lam Date: Wed, 24 Feb 2010 10:22:00 +1000 Subject: Disallow ids that start with upper case letters. Task-number: QT-2786 --- src/declarative/qml/qmlcompiler.cpp | 5 ++--- tests/auto/declarative/qmllanguage/tst_qmllanguage.cpp | 2 +- 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)); -- cgit v0.12