QmlJS: Support module apis defined by QML modules.

Change-Id: I18ec9daf8088f7db5ff2da11da14b539f501bab3
Reviewed-by: Fawzi Mohamed <fawzi.mohamed@nokia.com>
This commit is contained in:
Christian Kamm
2011-10-12 08:36:02 +02:00
parent 55420e2b70
commit 0b75a66407
7 changed files with 147 additions and 29 deletions

View File

@@ -1285,13 +1285,10 @@ CppQmlTypesLoader::BuiltinObjects CppQmlTypesLoader::loadQmlTypes(const QFileInf
QString error, warning;
QFile file(qmlTypeFile.absoluteFilePath());
if (file.open(QIODevice::ReadOnly)) {
QString contents = QString::fromUtf8(file.readAll());
QByteArray contents = file.readAll();
file.close();
TypeDescriptionReader reader(contents);
if (!reader(&newObjects))
error = reader.errorMessage();
warning = reader.warningMessage();
parseQmlTypeDescriptions(contents, &newObjects, 0, &error, &warning);
} else {
error = file.errorString();
}
@@ -1312,13 +1309,14 @@ CppQmlTypesLoader::BuiltinObjects CppQmlTypesLoader::loadQmlTypes(const QFileInf
void CppQmlTypesLoader::parseQmlTypeDescriptions(const QByteArray &xml,
BuiltinObjects *newObjects,
QList<ModuleApiInfo> *newModuleApis,
QString *errorMessage,
QString *warningMessage)
{
errorMessage->clear();
warningMessage->clear();
TypeDescriptionReader reader(QString::fromUtf8(xml));
if (!reader(newObjects)) {
if (!reader(newObjects, newModuleApis)) {
if (reader.errorMessage().isEmpty()) {
*errorMessage = QLatin1String("unknown error");
} else {