CppTools: Use only const pointers for ProjectInfo and ProjectPart

All members were already const, but this makes it clear at all points of
use that these data structures are immutable.

Change-Id: Iea615c090bde462c445d15223caccc561b0c713d
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
This commit is contained in:
Christian Kandeler
2021-08-20 11:21:06 +02:00
parent 5d8551559a
commit a952500e90
70 changed files with 284 additions and 271 deletions

View File

@@ -54,7 +54,7 @@ void CppParser::init(const Utils::FilePaths &filesToParse, bool fullParse)
bool CppParser::selectedForBuilding(const Utils::FilePath &fileName)
{
QList<CppTools::ProjectPart::Ptr> projParts =
QList<CppTools::ProjectPart::ConstPtr> projParts =
CppTools::CppModelManager::instance()->projectPart(fileName);
return !projParts.isEmpty() && projParts.at(0)->selectedForBuilding;
@@ -83,7 +83,7 @@ bool precompiledHeaderContains(const CPlusPlus::Snapshot &snapshot,
const std::function<bool(const QString &)> &checker)
{
const CppTools::CppModelManager *modelManager = CppTools::CppModelManager::instance();
const QList<CppTools::ProjectPart::Ptr> projectParts = modelManager->projectPart(filePath);
const QList<CppTools::ProjectPart::ConstPtr> projectParts = modelManager->projectPart(filePath);
if (projectParts.isEmpty())
return false;
const QStringList precompiledHeaders = projectParts.first()->precompiledHeaders;