Commit 45415783 authored by Christian Kamm's avatar Christian Kamm
Browse files

QmlJS: Get rid of xml file describing qml builtin types.

The type information is now generated at runtime.
parent e4871393
......@@ -1939,7 +1939,7 @@ const Value *Function::invoke(const Activation *activation) const
// typing environment
////////////////////////////////////////////////////////////////////////////////
QList<const FakeMetaObject *> CppQmlTypesLoader::objectsFromXml;
QList<const FakeMetaObject *> CppQmlTypesLoader::builtinObjects;
QStringList CppQmlTypesLoader::load(const QFileInfoList &xmlFiles)
{
......@@ -1968,7 +1968,7 @@ QStringList CppQmlTypesLoader::load(const QFileInfoList &xmlFiles)
QMapIterator<QString, FakeMetaObject *> it(newObjects);
while (it.hasNext()) {
it.next();
objectsFromXml.append(it.value());
builtinObjects.append(it.value());
}
}
......@@ -2359,7 +2359,7 @@ Engine::Engine()
{
initializePrototypes();
_cppQmlTypes.load(this, CppQmlTypesLoader::objectsFromXml);
_cppQmlTypes.load(this, CppQmlTypesLoader::builtinObjects);
}
Engine::~Engine()
......
......@@ -517,7 +517,7 @@ class QMLJS_EXPORT CppQmlTypesLoader
public:
/** \return an empty list when successful, error messages otherwise. */
static QStringList load(const QFileInfoList &xmlFiles);
static QList<const FakeMetaObject *> objectsFromXml;
static QList<const FakeMetaObject *> builtinObjects;
// parses the xml string and fills the newObjects map
static QString parseQmlTypeXml(const QByteArray &xml, QMap<QString, FakeMetaObject *> *newObjects);
......
......@@ -89,6 +89,9 @@ void ModelManager::loadQmlTypeDescriptions()
const QStringList errors = Interpreter::CppQmlTypesLoader::load(xmlFiles);
foreach (const QString &error, errors)
qWarning() << qPrintable(error);
// loads the builtin types
loadQmlPluginTypes(QString());
}
Snapshot ModelManager::snapshot() const
......@@ -493,7 +496,11 @@ void ModelManager::qmlPluginTypeDumpDone(int exitCode)
QMutexLocker locker(&m_mutex);
LibraryInfo libraryInfo = _snapshot.libraryInfo(libraryPath);
libraryInfo.setMetaObjects(objectsList);
_snapshot.insertLibraryInfo(libraryPath, libraryInfo);
if (!libraryPath.isEmpty()) {
LibraryInfo libraryInfo = _snapshot.libraryInfo(libraryPath);
libraryInfo.setMetaObjects(objectsList);
_snapshot.insertLibraryInfo(libraryPath, libraryInfo);
} else {
Interpreter::CppQmlTypesLoader::builtinObjects.append(objectsList);
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment