forked from qt-creator/qt-creator
QmlJS: Get rid of xml file describing qml builtin types.
The type information is now generated at runtime.
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -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()
|
||||||
|
@@ -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);
|
||||||
|
@@ -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);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user