AutoTest: Avoid some unneeded fetching of snapshot

Change-Id: I002b3537c2f1b468c52b08017e30efd4c969aeb2
Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
Christian Stenger
2023-07-04 08:01:21 +02:00
parent 91bdbb61ec
commit a85d7ef538

View File

@@ -165,8 +165,6 @@ QList<Document::Ptr> QuickTestParser::scanDirectoryForQuickTestQmlFiles(const Fi
ModelManagerInterface::importScan(ModelManagerInterface::workingCopy(), paths, qmlJsMM, ModelManagerInterface::importScan(ModelManagerInterface::workingCopy(), paths, qmlJsMM,
false /*emitDocumentChanges*/, false /*onlyTheLib*/, true /*forceRescan*/ ); false /*emitDocumentChanges*/, false /*onlyTheLib*/, true /*forceRescan*/ );
const Snapshot snapshot = QmlJSTools::Internal::ModelManager::instance()->snapshot();
QDirIterator it(srcDir.toString(), QDirIterator it(srcDir.toString(),
QDir::Dirs | QDir::NoDotAndDotDot, QDir::Dirs | QDir::NoDotAndDotDot,
QDirIterator::Subdirectories); QDirIterator::Subdirectories);
@@ -184,7 +182,7 @@ QList<Document::Ptr> QuickTestParser::scanDirectoryForQuickTestQmlFiles(const Fi
QList<Document::Ptr> foundDocs; QList<Document::Ptr> foundDocs;
for (const FilePath &path : std::as_const(dirs)) { for (const FilePath &path : std::as_const(dirs)) {
const QList<Document::Ptr> docs = snapshot.documentsInDirectory(path); const QList<Document::Ptr> docs = m_qmlSnapshot.documentsInDirectory(path);
for (const Document::Ptr &doc : docs) { for (const Document::Ptr &doc : docs) {
const FilePath fi = doc->fileName(); const FilePath fi = doc->fileName();
//const QFileInfo fi(doc->fileName()); //const QFileInfo fi(doc->fileName());