summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAaron Kennedy <aaron.kennedy@nokia.com>2009-10-13 05:48:00 (GMT)
committerAaron Kennedy <aaron.kennedy@nokia.com>2009-10-13 05:48:00 (GMT)
commit81142c25f01738dea784144fb2f186cb563cc2bd (patch)
treedef527e5f71ebfb070c676696e032fcf3c2510d4
parent5339cd51fa4235b87a41135b8a7d8bcc671a0e88 (diff)
parent278b97494dbeed4be391caf32537fd19f19f0186 (diff)
downloadQt-81142c25f01738dea784144fb2f186cb563cc2bd.zip
Qt-81142c25f01738dea784144fb2f186cb563cc2bd.tar.gz
Qt-81142c25f01738dea784144fb2f186cb563cc2bd.tar.bz2
Merge branch 'kinetic-declarativeui' of git@scm.dev.nokia.troll.no:qt/kinetic into kinetic-declarativeui
-rw-r--r--src/declarative/qml/qmlscriptparser.cpp13
-rw-r--r--tests/auto/declarative/qmllanguage/data/importVersionMissingBuiltIn.errors.txt2
-rw-r--r--tests/auto/declarative/qmllanguage/data/importVersionMissingInstalled.errors.txt2
3 files changed, 13 insertions, 4 deletions
diff --git a/src/declarative/qml/qmlscriptparser.cpp b/src/declarative/qml/qmlscriptparser.cpp
index 57e40b6..9cc12b3 100644
--- a/src/declarative/qml/qmlscriptparser.cpp
+++ b/src/declarative/qml/qmlscriptparser.cpp
@@ -294,10 +294,11 @@ ProcessAST::defineObjectBinding_helper(AST::UiQualifiedId *propertyName,
if (isScript) {
if (_stateStack.isEmpty() || _stateStack.top().property) {
QmlError error;
- error.setDescription(QLatin1String("Invalid use of Script block"));
+ error.setDescription(QCoreApplication::translate("QmlParser","Invalid use of Script block"));
error.setLine(typeLocation.startLine);
error.setColumn(typeLocation.startColumn);
_parser->_errors << error;
+ return 0;
}
}
@@ -474,7 +475,7 @@ bool ProcessAST::visit(AST::UiImport *node)
import.qualifier = node->importId->asString();
if (!import.qualifier.at(0).isUpper()) {
QmlError error;
- error.setDescription(QLatin1String("Invalid import qualifier ID"));
+ error.setDescription(QCoreApplication::translate("QmlParser","Invalid import qualifier ID"));
error.setLine(node->importIdToken.startLine);
error.setColumn(node->importIdToken.startColumn);
_parser->_errors << error;
@@ -483,6 +484,14 @@ bool ProcessAST::visit(AST::UiImport *node)
}
if (node->versionToken.isValid())
import.version = textAt(node->versionToken);
+ else if (import.type == QmlScriptParser::Import::Library) {
+ QmlError error;
+ error.setDescription(QCoreApplication::translate("QmlParser","Library import requires a version"));
+ error.setLine(node->importIdToken.startLine);
+ error.setColumn(node->importIdToken.startColumn);
+ _parser->_errors << error;
+ return false;
+ }
import.location = location(startLoc, endLoc);
import.uri = uri;
diff --git a/tests/auto/declarative/qmllanguage/data/importVersionMissingBuiltIn.errors.txt b/tests/auto/declarative/qmllanguage/data/importVersionMissingBuiltIn.errors.txt
index 2235cbc..c7d880e 100644
--- a/tests/auto/declarative/qmllanguage/data/importVersionMissingBuiltIn.errors.txt
+++ b/tests/auto/declarative/qmllanguage/data/importVersionMissingBuiltIn.errors.txt
@@ -1 +1 @@
-SHOULD GIVE AN ERROR ABOUT MISSING VERSION
+1:16:Library import requires a version
diff --git a/tests/auto/declarative/qmllanguage/data/importVersionMissingInstalled.errors.txt b/tests/auto/declarative/qmllanguage/data/importVersionMissingInstalled.errors.txt
index 2235cbc..89e58ee 100644
--- a/tests/auto/declarative/qmllanguage/data/importVersionMissingInstalled.errors.txt
+++ b/tests/auto/declarative/qmllanguage/data/importVersionMissingInstalled.errors.txt
@@ -1 +1 @@
-SHOULD GIVE AN ERROR ABOUT MISSING VERSION
+1:35:Library import requires a version