QmlProfiler: Add QT_INSTALL_QML paths to FileInProjectFinder

This enables us to find QML files that are part of Qt, also if they are
not in the same location on the host and target systems.

Change-Id: Idcd0be8ae4301000c4123e39edeb04b43efb4659
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
Ulf Hermann
2017-09-27 14:57:05 +02:00
parent 38d00cc8b6
commit d8a41f2706

View File

@@ -34,6 +34,7 @@
#include <qmljs/parser/qmljsast_p.h>
#include <qmljs/qmljsmodelmanagerinterface.h>
#include <qmljstools/qmljsmodelmanager.h>
#include <qtsupport/qtkitinformation.h>
#include <utils/qtcassert.h>
@@ -242,16 +243,21 @@ void QmlProfilerDetailsRewriter::populateFileFinder(const ProjectExplorer::Targe
// ... and find the sysroot if we have any target at all.
QString activeSysroot;
QStringList additionalSearchDirectories;
if (target) {
const ProjectExplorer::Kit *kit = target->kit();
if (kit && ProjectExplorer::SysRootKitInformation::hasSysRoot(kit))
if (const ProjectExplorer::Kit *kit = target->kit()) {
if (ProjectExplorer::SysRootKitInformation::hasSysRoot(kit))
activeSysroot = ProjectExplorer::SysRootKitInformation::sysRoot(kit).toString();
if (QtSupport::BaseQtVersion *qtVersion = QtSupport::QtKitInformation::qtVersion(kit))
additionalSearchDirectories.append(qtVersion->qmakeProperty("QT_INSTALL_QML"));
}
}
// Finally, do populate m_projectFinder
m_projectFinder.setProjectDirectory(projectDirectory);
m_projectFinder.setProjectFiles(sourceFiles);
m_projectFinder.setSysroot(activeSysroot);
m_projectFinder.setAdditionalSearchDirectories(additionalSearchDirectories);
m_filesCache.clear();
}