Commit 27b48029 authored by Tobias Hunger's avatar Tobias Hunger

UiCodemodel support for qbs

Change-Id: I0c83f3bb5c1c127169d695f42c169f4e28d1b06d
Reviewed-by: default avatarTobias Hunger <tobias.hunger@digia.com>
parent 97d76b8c
......@@ -56,6 +56,7 @@
#include <projectexplorer/toolchain.h>
#include <projectexplorer/headerpath.h>
#include <qtsupport/qtkitinformation.h>
#include <qtsupport/uicodemodelsupport.h>
#include <qmljstools/qmljsmodelmanager.h>
#include <qmljs/qmljsmodelmanagerinterface.h>
......@@ -527,6 +528,7 @@ void QbsProject::updateCppCodeModel(const qbs::ProjectData &prj)
qtVersionForPart = CppTools::ProjectPart::Qt5;
}
QHash<QString, QString> uiFiles;
QStringList allFiles;
foreach (const qbs::ProductData &prd, prj.allProducts()) {
foreach (const qbs::GroupData &grp, prd.groups()) {
......@@ -578,9 +580,16 @@ void QbsProject::updateCppCodeModel(const qbs::ProjectData &prj)
ProjectExplorer::SysRootKitInformation::sysRoot(k));
CppTools::ProjectFileAdder adder(part->files);
foreach (const QString &file, grp.allFilePaths())
foreach (const QString &file, grp.allFilePaths()) {
if (file.endsWith(QLatin1String(".ui"))) {
QStringList generated = m_rootProjectNode->qbsProject()
->generatedFiles(prd, file, QStringList(QLatin1String("hpp")));
if (generated.count() == 1)
uiFiles.insert(file, generated.at(0));
}
if (adder.maybeAdd(file))
allFiles.append(file);
}
part->files << CppTools::ProjectFile(QLatin1String(CONFIGURATION_PATH),
CppTools::ProjectFile::CXXHeader);
......@@ -598,6 +607,8 @@ void QbsProject::updateCppCodeModel(const qbs::ProjectData &prj)
if (pinfo.projectParts().isEmpty())
return;
QtSupport::UiCodeModelManager::update(this, uiFiles);
// Register update the code model:
m_codeModelFuture = modelmanager->updateProjectInfo(pinfo);
}
......
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