-
Task
-
Resolution: Unresolved
-
P2: Important
-
None
-
None
-
None
We do some filtering in the item library, which is already done in the project storage. There is simply no need for that, and it makes the code complex and slow.
For example, the following code collects information we already have in the project storage.
QmlDesigner::Imports createPossibleFileImports(const Utils::FilePath &path) { auto folder = path.parentDir(); QmlDesigner::Imports imports; /* Creates imports for all sub folder that contain a qml file. */ folder.iterateDirectory( [&](const Utils::FilePath &item) { bool append = false; item.iterateDirectory( [&](const Utils::FilePath &) { append = true; return Utils::IterationPolicy::Stop; }, {{"*.qml"}, QDir::Files}); if (append) imports.append(QmlDesigner::Import::createFileImport(item.fileName())); return Utils::IterationPolicy::Continue; }, {{}, QDir::Dirs | QDir::NoDotAndDotDot}); return imports; }