QmlProfiler: Don't scan the whole file system in rewriter test

QLibraryInfo::location() returns one string. Iterating over that gives
us the individual characters, beginning with '/'. Running that through
FileName::fromString(), gives us "/", and feeding this to
ModelManagerInterface::importScan() is not funny.

Change-Id: I627e5739337efacc0632d8a476bb5ad3093793ea
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
This commit is contained in:
Ulf Hermann
2018-07-13 16:34:49 +02:00
parent fd782687fe
commit af8bd12387

View File

@@ -213,8 +213,9 @@ void QmlProfilerDetailsRewriterTest::seedRewriter()
QFutureInterface<void> result; QFutureInterface<void> result;
QmlJS::PathsAndLanguages lPaths; QmlJS::PathsAndLanguages lPaths;
for (auto p : QLibraryInfo::location(QLibraryInfo::Qml2ImportsPath)) lPaths.maybeInsert(
lPaths.maybeInsert(Utils::FileName::fromString(p), QmlJS::Dialect::Qml); Utils::FileName::fromString(QLibraryInfo::location(QLibraryInfo::Qml2ImportsPath)),
QmlJS::Dialect::Qml);
QmlJS::ModelManagerInterface::importScan(result, QmlJS::ModelManagerInterface::workingCopy(), QmlJS::ModelManagerInterface::importScan(result, QmlJS::ModelManagerInterface::workingCopy(),
lPaths, m_modelManager, false); lPaths, m_modelManager, false);