diff options
author | Kai Koehne <kai.koehne@nokia.com> | 2009-08-21 11:15:28 (GMT) |
---|---|---|
committer | Kai Koehne <kai.koehne@nokia.com> | 2009-08-21 11:22:34 (GMT) |
commit | bf04e19750502ea6346eb6eac08a6370b11dd0e3 (patch) | |
tree | dc3e097c6e82041438a90f1f429e6ecfae9efca1 /src/declarative/qml/qmlcompiler.cpp | |
parent | 715056fe9939452c0223f5d8ff217bed3b8015de (diff) | |
download | Qt-bf04e19750502ea6346eb6eac08a6370b11dd0e3.zip Qt-bf04e19750502ea6346eb6eac08a6370b11dd0e3.tar.gz Qt-bf04e19750502ea6346eb6eac08a6370b11dd0e3.tar.bz2 |
Store location information for "Type XXX is not available" messages
QmlScriptParser now also stores the locations where a specific type
was referenced.
Diffstat (limited to 'src/declarative/qml/qmlcompiler.cpp')
-rw-r--r-- | src/declarative/qml/qmlcompiler.cpp | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/declarative/qml/qmlcompiler.cpp b/src/declarative/qml/qmlcompiler.cpp index 1fb4b46..1771cb4 100644 --- a/src/declarative/qml/qmlcompiler.cpp +++ b/src/declarative/qml/qmlcompiler.cpp @@ -569,6 +569,7 @@ bool QmlCompiler::compile(QmlEngine *engine, for (int ii = 0; ii < unit->types.count(); ++ii) { QmlCompositeTypeData::TypeReference &tref = unit->types[ii]; QmlCompiledData::TypeReference ref; + QmlScriptParser::TypeReference *parserRef = unit->data.referencedTypes().at(ii); if (tref.type) ref.type = tref.type; else if (tref.unit) { @@ -578,7 +579,13 @@ bool QmlCompiler::compile(QmlEngine *engine, QmlError error; error.setUrl(output->url); error.setDescription(QLatin1String("Unable to create type ") + - unit->data.types().at(ii)); + parserRef->name); + if (!parserRef->refObjects.isEmpty()) { + QmlParser::Object *parserObject = parserRef->refObjects.first(); + error.setLine(parserObject->location.start.line); + error.setColumn(parserObject->location.start.column); + } + exceptions << error; exceptions << ref.component->errors(); reset(out); @@ -587,7 +594,7 @@ bool QmlCompiler::compile(QmlEngine *engine, ref.ref = tref.unit; ref.ref->addref(); } - ref.className = unit->data.types().at(ii).toLatin1(); + ref.className = parserRef->name.toLatin1(); out->types << ref; } |