CMakeProject: Prefer assignment to out parameter

Also change method names from update...() to create...() and mark as
const. This communicates that the objects the methods are called on are
neither altered nor updated.

Change-Id: I29e84dc398ded3ffcbf90741227362c6b4be2bf9
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
This commit is contained in:
Bernhard Beschow
2019-01-20 15:25:18 +01:00
parent e3522fd718
commit 693e2649a4
8 changed files with 25 additions and 19 deletions

View File

@@ -285,8 +285,7 @@ void CMakeProject::updateProjectData(CMakeBuildConfiguration *bc)
QtSupport::CppKitInfo kitInfo(this);
QTC_ASSERT(kitInfo.isValid(), return);
CppTools::RawProjectParts rpps;
m_buildDirManager.updateCodeModel(rpps);
CppTools::RawProjectParts rpps = m_buildDirManager.createRawProjectParts();
for (CppTools::RawProjectPart &rpp : rpps) {
rpp.setQtVersion(kitInfo.projectPartQtVersion); // TODO: Check if project actually uses Qt.