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.

This has to be backported as the sheer volume of files to be scanned
makes the tests time out.

(cherry-picked from commit af8bd12387)
Change-Id: Ib4293437ab83da8ed10a696fba2c30f5c51c8124
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
Ulf Hermann
2018-07-13 16:34:49 +02:00
parent faccb8fd71
commit 8ef4964168

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);