summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoberto Raggi <roberto.raggi@nokia.com>2009-04-24 08:58:34 (GMT)
committerRoberto Raggi <roberto.raggi@nokia.com>2009-04-24 08:58:34 (GMT)
commit06164e4607ddc8eafabd3ed463c309a7075188b6 (patch)
tree7c56034d60cb507d46153316aa8aa992cfcf4fb6
parent2a74fb788d720e0532f7edde457d3b076dec18f5 (diff)
downloadQt-06164e4607ddc8eafabd3ed463c309a7075188b6.zip
Qt-06164e4607ddc8eafabd3ed463c309a7075188b6.tar.gz
Qt-06164e4607ddc8eafabd3ed463c309a7075188b6.tar.bz2
Compile.
-rw-r--r--src/declarative/qml/qmldom.cpp13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/declarative/qml/qmldom.cpp b/src/declarative/qml/qmldom.cpp
index 54cc2e4..bd4d987 100644
--- a/src/declarative/qml/qmldom.cpp
+++ b/src/declarative/qml/qmldom.cpp
@@ -152,6 +152,12 @@ bool QmlDomDocument::load(QmlEngine *engine, const QByteArray &data)
{
d->error = QString();
+ QmlXmlParser parser;
+ if(!parser.parse(data)) {
+ d->error = parser.errorDescription();
+ return false;
+ }
+
QmlCompiledComponent component;
QmlCompiler compiler;
// ###
@@ -162,15 +168,16 @@ bool QmlDomDocument::load(QmlEngine *engine, const QByteArray &data)
return false;
}
- if(tree) {
- component.dump(0, tree);
- d->root = tree;
+ if(parser.tree()) {
+ component.dump(0, parser.tree());
+ d->root = parser.tree();
d->root->addref();
}
return true;
}
+
/*!
Returns the last load error. The load error will be reset after a
successful call to load().