Commit 7b970a3a authored by Christian Kandeler's avatar Christian Kandeler
Browse files

QbsProjectManager: Support an equivalent of QML_IMPORT_PATH.



Task-number: QTCREATORBUG-14849
Change-Id: I26f69b5c6c421b5eb965c96d75df15d16e960237
Reviewed-by: default avatarJoerg Bornemann <joerg.bornemann@theqtcompany.com>
parent aa8998cf
......@@ -440,6 +440,8 @@ Import LinkPrivate::importNonFile(Document::Ptr doc, const ImportInfo &importInf
"Import paths:\n"
"%1\n\n"
"For qmake projects, use the QML_IMPORT_PATH variable to add import paths.\n"
"For qbs projects, declare and set a qmlImportPaths property in your product "
"to add import paths.\n"
"For qmlproject projects, use the importPaths property to add import paths.").arg(
importPaths.join(QLatin1Char('\n'))));
}
......
......@@ -857,6 +857,13 @@ void QbsProject::updateQmlJsCodeModel()
QmlJS::ModelManagerInterface::ProjectInfo projectInfo =
modelManager->defaultProjectInfoForProject(this);
foreach (const qbs::ProductData &product, m_projectData.allProducts()) {
static const QString propertyName = QLatin1String("qmlImportPaths");
foreach (const QString &path, product.properties().value(propertyName).toStringList()) {
projectInfo.importPaths.maybeInsert(Utils::FileName::fromString(path),
QmlJS::Dialect::Qml);
}
}
setProjectLanguage(ProjectExplorer::Constants::LANG_QMLJS, !projectInfo.sourceFiles.isEmpty());
modelManager->updateProjectInfo(projectInfo, this);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment