CppEditor: Remove foreach / Q_FOREACH usage

Task-number: QTCREATORBUG-27464
Change-Id: I9915cf2c07bdcc570efc20601752d60f2ec82f34
Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
Artem Sokolovskii
2022-05-05 13:44:45 +02:00
parent 556ec7c20e
commit 7e69b64b74
12 changed files with 102 additions and 79 deletions

View File

@@ -1139,8 +1139,9 @@ void ProjectPartsModel::configure(const QList<ProjectInfo::ConstPtr> &projectInf
{
emit layoutAboutToBeChanged();
m_projectPartsList.clear();
foreach (const ProjectInfo::ConstPtr &info, projectInfos) {
foreach (const ProjectPart::ConstPtr &projectPart, info->projectParts()) {
for (const ProjectInfo::ConstPtr &info : qAsConst(projectInfos)) {
const QVector<ProjectPart::ConstPtr> projectParts = info->projectParts();
for (const ProjectPart::ConstPtr &projectPart : projectParts) {
if (!m_projectPartsList.contains(projectPart)) {
m_projectPartsList << projectPart;
if (projectPart == currentEditorsProjectPart)
@@ -1160,7 +1161,7 @@ QModelIndex ProjectPartsModel::indexForCurrentEditorsProjectPart() const
ProjectPart::ConstPtr ProjectPartsModel::projectPartForProjectId(const QString &projectPartId) const
{
foreach (const ProjectPart::ConstPtr &part, m_projectPartsList) {
for (const ProjectPart::ConstPtr &part : qAsConst(m_projectPartsList)) {
if (part->id() == projectPartId)
return part;
}