forked from qt-creator/qt-creator
QmlJS: Delay loading of default QML type descriptions
We definitely do not need to do this during startup of Qt Creator, delay to first use. Change-Id: I5942b5346aedc3d6b677918ad28a6c2924d09493 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
This commit is contained in:
@@ -1321,10 +1321,32 @@ const Function *Function::asFunction() const
|
||||
// typing environment
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
CppQmlTypesLoader::BuiltinObjects CppQmlTypesLoader::defaultLibraryObjects;
|
||||
CppQmlTypesLoader::BuiltinObjects CppQmlTypesLoader::defaultQtObjects;
|
||||
CppQmlTypesLoader::BuiltinObjects sDefaultLibraryObjects;
|
||||
CppQmlTypesLoader::BuiltinObjects sDefaultQtObjects;
|
||||
std::function<void()> CppQmlTypesLoader::defaultObjectsInitializer;
|
||||
|
||||
CppQmlTypesLoader::BuiltinObjects CppQmlTypesLoader::loadQmlTypes(const QFileInfoList &qmlTypeFiles, QStringList *errors, QStringList *warnings)
|
||||
CppQmlTypesLoader::BuiltinObjects &CppQmlTypesLoader::defaultQtObjects()
|
||||
{
|
||||
if (defaultObjectsInitializer) {
|
||||
const std::function<void()> init = defaultObjectsInitializer;
|
||||
defaultObjectsInitializer = {};
|
||||
init();
|
||||
}
|
||||
return sDefaultLibraryObjects;
|
||||
}
|
||||
CppQmlTypesLoader::BuiltinObjects &CppQmlTypesLoader::defaultLibraryObjects()
|
||||
{
|
||||
if (defaultObjectsInitializer) {
|
||||
const std::function<void()> init = defaultObjectsInitializer;
|
||||
defaultObjectsInitializer = {};
|
||||
init();
|
||||
}
|
||||
return sDefaultQtObjects;
|
||||
}
|
||||
|
||||
CppQmlTypesLoader::BuiltinObjects CppQmlTypesLoader::loadQmlTypes(const QFileInfoList &qmlTypeFiles,
|
||||
QStringList *errors,
|
||||
QStringList *warnings)
|
||||
{
|
||||
QHash<QString, FakeMetaObject::ConstPtr> newObjects;
|
||||
QStringList newDependencies;
|
||||
|
||||
Reference in New Issue
Block a user