forked from qt-creator/qt-creator
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:
@@ -34,6 +34,7 @@
|
|||||||
#include <qmljs/parser/qmljsast_p.h>
|
#include <qmljs/parser/qmljsast_p.h>
|
||||||
#include <qmljs/qmljsmodelmanagerinterface.h>
|
#include <qmljs/qmljsmodelmanagerinterface.h>
|
||||||
#include <qmljstools/qmljsmodelmanager.h>
|
#include <qmljstools/qmljsmodelmanager.h>
|
||||||
|
#include <qtsupport/qtkitinformation.h>
|
||||||
|
|
||||||
#include <utils/qtcassert.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.
|
// ... and find the sysroot if we have any target at all.
|
||||||
QString activeSysroot;
|
QString activeSysroot;
|
||||||
|
QStringList additionalSearchDirectories;
|
||||||
if (target) {
|
if (target) {
|
||||||
const ProjectExplorer::Kit *kit = target->kit();
|
if (const ProjectExplorer::Kit *kit = target->kit()) {
|
||||||
if (kit && ProjectExplorer::SysRootKitInformation::hasSysRoot(kit))
|
if (ProjectExplorer::SysRootKitInformation::hasSysRoot(kit))
|
||||||
activeSysroot = ProjectExplorer::SysRootKitInformation::sysRoot(kit).toString();
|
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
|
// Finally, do populate m_projectFinder
|
||||||
m_projectFinder.setProjectDirectory(projectDirectory);
|
m_projectFinder.setProjectDirectory(projectDirectory);
|
||||||
m_projectFinder.setProjectFiles(sourceFiles);
|
m_projectFinder.setProjectFiles(sourceFiles);
|
||||||
m_projectFinder.setSysroot(activeSysroot);
|
m_projectFinder.setSysroot(activeSysroot);
|
||||||
|
m_projectFinder.setAdditionalSearchDirectories(additionalSearchDirectories);
|
||||||
m_filesCache.clear();
|
m_filesCache.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user