summaryrefslogtreecommitdiffstats
path: root/src/declarative/qml/qmlscriptparser.cpp
diff options
context:
space:
mode:
authorWarwick Allison <warwick.allison@nokia.com>2009-10-13 05:22:05 (GMT)
committerWarwick Allison <warwick.allison@nokia.com>2009-10-13 05:22:05 (GMT)
commit423ccd84379a6d8af647f76ed4bddac767230f17 (patch)
treeb618c6bfc983bb1e99e61f56aad28ebe5441b978 /src/declarative/qml/qmlscriptparser.cpp
parent2c36d7c63fc88b1f06582884fd3ea0b26534a2cd (diff)
downloadQt-423ccd84379a6d8af647f76ed4bddac767230f17.zip
Qt-423ccd84379a6d8af647f76ed4bddac767230f17.tar.gz
Qt-423ccd84379a6d8af647f76ed4bddac767230f17.tar.bz2
Library importing requires a version. Fix and test.
Diffstat (limited to 'src/declarative/qml/qmlscriptparser.cpp')
-rw-r--r--src/declarative/qml/qmlscriptparser.cpp12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/declarative/qml/qmlscriptparser.cpp b/src/declarative/qml/qmlscriptparser.cpp
index 57e40b6..c45bdcc 100644
--- a/src/declarative/qml/qmlscriptparser.cpp
+++ b/src/declarative/qml/qmlscriptparser.cpp
@@ -294,7 +294,7 @@ 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;
@@ -474,7 +474,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 +483,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;