forked from qt-creator/qt-creator
QmlProject: fixing QML import path for .qmlproject
The code is similar to what we do in Qt4Node. Change-Id: I4f206f8acdb38d7813160a7ecabc1ffd5daedcfb Reviewed-by: Fawzi Mohamed <fawzi.mohamed@digia.com>
This commit is contained in:
committed by
Fawzi Mohamed
parent
75ed1ce041
commit
b09f0c61cf
@@ -168,22 +168,33 @@ void QmlProject::refresh(RefreshOptions options)
|
||||
if (options & Files)
|
||||
m_rootNode->refresh();
|
||||
|
||||
QmlJS::ModelManagerInterface::ProjectInfo pinfo(this);
|
||||
pinfo.sourceFiles = files();
|
||||
pinfo.importPaths = customImportPaths();
|
||||
QtSupport::BaseQtVersion *version = 0;
|
||||
if (activeTarget()) {
|
||||
ProjectExplorer::ToolChain *tc = ProjectExplorer::ToolChainKitInformation::toolChain(activeTarget()->kit());
|
||||
version = QtSupport::QtKitInformation::qtVersion(activeTarget()->kit());
|
||||
QtSupport::QmlDumpTool::pathAndEnvironment(this, version, tc, false, &pinfo.qmlDumpPath, &pinfo.qmlDumpEnvironment);
|
||||
QmlJS::ModelManagerInterface::ProjectInfo projectInfo(this);
|
||||
projectInfo.sourceFiles = files();
|
||||
projectInfo.importPaths = customImportPaths();
|
||||
|
||||
QtSupport::BaseQtVersion *qtVersion = 0;
|
||||
{
|
||||
ProjectExplorer::Target *target = activeTarget();
|
||||
ProjectExplorer::Kit *kit = target ? target->kit() : ProjectExplorer::KitManager::instance()->defaultKit();
|
||||
ProjectExplorer::ToolChain *toolChain = ProjectExplorer::ToolChainKitInformation::toolChain(kit);
|
||||
qtVersion = QtSupport::QtKitInformation::qtVersion(kit);
|
||||
QtSupport::QmlDumpTool::pathAndEnvironment(this, qtVersion, toolChain, false,
|
||||
&projectInfo.qmlDumpPath, &projectInfo.qmlDumpEnvironment);
|
||||
}
|
||||
if (version) {
|
||||
pinfo.tryQmlDump = true;
|
||||
pinfo.qtImportsPath = version->qmakeProperty("QT_INSTALL_IMPORTS");
|
||||
pinfo.qtQmlPath = version->qmakeProperty("QT_INSTALL_QML");
|
||||
pinfo.qtVersionString = version->qtVersionString();
|
||||
|
||||
if (qtVersion) {
|
||||
projectInfo.tryQmlDump = true;
|
||||
projectInfo.qtImportsPath = qtVersion->qmakeProperty("QT_INSTALL_IMPORTS");
|
||||
projectInfo.qtQmlPath = qtVersion->qmakeProperty("QT_INSTALL_QML");
|
||||
projectInfo.qtVersionString = qtVersion->qtVersionString();
|
||||
|
||||
if (!projectInfo.qtQmlPath.isEmpty())
|
||||
projectInfo.importPaths += projectInfo.qtQmlPath;
|
||||
if (!projectInfo.qtImportsPath.isEmpty())
|
||||
projectInfo.importPaths += projectInfo.qtImportsPath;
|
||||
|
||||
}
|
||||
m_modelManager->updateProjectInfo(pinfo);
|
||||
m_modelManager->updateProjectInfo(projectInfo);
|
||||
}
|
||||
|
||||
QStringList QmlProject::convertToAbsoluteFiles(const QStringList &paths) const
|
||||
|
Reference in New Issue
Block a user