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

The type information is now generated at runtime.
This commit is contained in:
Christian Kamm
2010-06-10 10:48:23 +02:00
parent e4871393c6
commit 45415783e7
4 changed files with 14 additions and 3178 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -1939,7 +1939,7 @@ const Value *Function::invoke(const Activation *activation) const
// typing environment // typing environment
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
QList<const FakeMetaObject *> CppQmlTypesLoader::objectsFromXml; QList<const FakeMetaObject *> CppQmlTypesLoader::builtinObjects;
QStringList CppQmlTypesLoader::load(const QFileInfoList &xmlFiles) QStringList CppQmlTypesLoader::load(const QFileInfoList &xmlFiles)
{ {
@@ -1968,7 +1968,7 @@ QStringList CppQmlTypesLoader::load(const QFileInfoList &xmlFiles)
QMapIterator<QString, FakeMetaObject *> it(newObjects); QMapIterator<QString, FakeMetaObject *> it(newObjects);
while (it.hasNext()) { while (it.hasNext()) {
it.next(); it.next();
objectsFromXml.append(it.value()); builtinObjects.append(it.value());
} }
} }
@@ -2359,7 +2359,7 @@ Engine::Engine()
{ {
initializePrototypes(); initializePrototypes();
_cppQmlTypes.load(this, CppQmlTypesLoader::objectsFromXml); _cppQmlTypes.load(this, CppQmlTypesLoader::builtinObjects);
} }
Engine::~Engine() Engine::~Engine()

View File

@@ -517,7 +517,7 @@ class QMLJS_EXPORT CppQmlTypesLoader
public: public:
/** \return an empty list when successful, error messages otherwise. */ /** \return an empty list when successful, error messages otherwise. */
static QStringList load(const QFileInfoList &xmlFiles); 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 // parses the xml string and fills the newObjects map
static QString parseQmlTypeXml(const QByteArray &xml, QMap<QString, FakeMetaObject *> *newObjects); static QString parseQmlTypeXml(const QByteArray &xml, QMap<QString, FakeMetaObject *> *newObjects);

View File

@@ -89,6 +89,9 @@ void ModelManager::loadQmlTypeDescriptions()
const QStringList errors = Interpreter::CppQmlTypesLoader::load(xmlFiles); const QStringList errors = Interpreter::CppQmlTypesLoader::load(xmlFiles);
foreach (const QString &error, errors) foreach (const QString &error, errors)
qWarning() << qPrintable(error); qWarning() << qPrintable(error);
// loads the builtin types
loadQmlPluginTypes(QString());
} }
Snapshot ModelManager::snapshot() const Snapshot ModelManager::snapshot() const
@@ -493,7 +496,11 @@ void ModelManager::qmlPluginTypeDumpDone(int exitCode)
QMutexLocker locker(&m_mutex); QMutexLocker locker(&m_mutex);
LibraryInfo libraryInfo = _snapshot.libraryInfo(libraryPath); if (!libraryPath.isEmpty()) {
libraryInfo.setMetaObjects(objectsList); LibraryInfo libraryInfo = _snapshot.libraryInfo(libraryPath);
_snapshot.insertLibraryInfo(libraryPath, libraryInfo); libraryInfo.setMetaObjects(objectsList);
_snapshot.insertLibraryInfo(libraryPath, libraryInfo);
} else {
Interpreter::CppQmlTypesLoader::builtinObjects.append(objectsList);
}
} }