Add pointer qualifications to auto-typed variables that are deduced to pointers.

This commit is contained in:
Roman Telezhynskyi 2024-02-19 18:31:25 +02:00
parent 2134f969a0
commit ff018a3f2c
14 changed files with 22 additions and 22 deletions

View File

@ -293,7 +293,7 @@ void VPLayoutFileWriter::WritePiece(const VPPiecePtr &piece)
writeStartElement(ML::TagSeamLine);
QVector<VLayoutPoint> const contourPoints = piece->GetContourPoints();
for (auto &point : contourPoints)
for (const auto &point : contourPoints)
{
WriteLayoutPoint(point);
}
@ -307,7 +307,7 @@ void VPLayoutFileWriter::WritePiece(const VPPiecePtr &piece)
if (piece->IsSeamAllowance() && not piece->IsSeamAllowanceBuiltIn())
{
QVector<VLayoutPoint> const seamAllowancePoints = piece->GetSeamAllowancePoints();
for (auto &point : seamAllowancePoints)
for (const auto &point : seamAllowancePoints)
{
WriteLayoutPoint(point);
}
@ -350,7 +350,7 @@ void VPLayoutFileWriter::WritePiece(const VPPiecePtr &piece)
[](bool mirrored) noexcept { return mirrored; });
QVector<VLayoutPoint> const points = path.Points();
for (auto &point : points)
for (const auto &point : points)
{
WriteLayoutPoint(point);
}

View File

@ -313,7 +313,7 @@ void DialogMDataBase::InitDataBase(const QStringList &usedMeasurements)
}
QStringList const groups = knownDB.Groups();
for (auto &group : groups)
for (const auto &group : groups)
{
QMap<int, VKnownMeasurement> const groupMeasurements = knownDB.OrderedGroupMeasurements(group);
m_groups.append(InitGroup(group, groupMeasurements, usedMeasurements));

View File

@ -212,7 +212,7 @@ void DialogHistory::FillTable()
QVector<HistoryRecord> const historyRecords = QtConcurrent::blockingMapped(history, CreateRecord);
for (auto &record : historyRecords)
for (const auto &record : historyRecords)
{
if (not record.description.isEmpty())
{

View File

@ -1040,7 +1040,7 @@ void VDxfEngine::ExportAAMAIntcut(const QSharedPointer<dx_ifaceBlock> &detailBlo
};
QVector<VLayoutPiecePath> const drawIntCut = detail.MappedInternalPathsForCut(true);
for (auto &intCut : drawIntCut)
for (const auto &intCut : drawIntCut)
{
QVector<VLayoutPoint> points = intCut.Points();
DrawPolygon(points, false);
@ -1615,7 +1615,7 @@ void VDxfEngine::ExportASTMInternalCutout(const QSharedPointer<dx_ifaceBlock> &d
};
QVector<VLayoutPiecePath> const drawIntCut = detail.MappedInternalPathsForCut(true);
for (auto &intCut : drawIntCut)
for (const auto &intCut : drawIntCut)
{
QVector<VLayoutPoint> points = intCut.Points();
DrawPolygon(points, intCut.IsNotMirrored(), false);

View File

@ -154,7 +154,7 @@ auto VAbstartMeasurementDimension::ValidBasesList() const -> QStringList
QVector<qreal> const bases = ValidBases();
QStringList list;
list.reserve(bases.size());
for(auto &base : bases)
for (const auto &base : bases)
{
list.append(QString::number(base));
}
@ -382,7 +382,7 @@ void VDimensionRestriction::SetExcludeString(const QString &exclude)
m_exclude.clear();
QStringList const values = exclude.split(';');
for(auto &value : values)
for (const auto &value : values)
{
bool ok = false;
qreal const val = value.toDouble(&ok);
@ -400,7 +400,7 @@ auto VDimensionRestriction::GetExcludeString() const -> QString
QList<qreal> const list = m_exclude.values();
QStringList excludeList;
for(auto &value : list)
for (const auto &value : list)
{
excludeList.append(QString::number(value));
}

View File

@ -758,7 +758,7 @@ auto VPatternRecipe::SplinePath(const VToolRecord &record) -> QDomElement
throw VExceptionInvalidHistory(QObject::tr("Empty list of nodes for tool with id '%1'.").arg(record.getId()));
}
for (auto &pathNode : path)
for (const auto &pathNode : path)
{
QDomElement node = createElement(QStringLiteral("node"));
@ -804,7 +804,7 @@ auto VPatternRecipe::CubicBezierPath(const VToolRecord &record) -> QDomElement
throw VExceptionInvalidHistory(QObject::tr("Empty list of nodes for tool with id '%1'.").arg(record.getId()));
}
for (auto &pathNode : path)
for (const auto &pathNode : path)
{
QDomElement node = createElement(QStringLiteral("node"));
@ -1217,7 +1217,7 @@ auto VPatternRecipe::GroupOperationSource(VAbstractOperation *tool, quint32 id,
throw VExceptionInvalidHistory(QObject::tr("Empty list of nodes for tool with id '%1'.").arg(id));
}
for (auto &item : items)
for (const auto &item : items)
{
QDomElement node = createElement(QStringLiteral("node"));

View File

@ -357,7 +357,7 @@ auto VBoundary::InsertDisconnect(QList<VBoundarySequenceItemData> &sequence, int
}
QVector<QVector<VLayoutPoint>> const shape = PreparePassmarkShape(passmark, drawMode, item.mirror);
for (auto &subShape : shape)
for (const auto &subShape : shape)
{
sequence.insert(i, PrepareSequenceItem(subShape, drawMode, VBoundarySequenceItem::PassmarkShape));
}

View File

@ -247,7 +247,7 @@ auto VPosition::ArrangeDetail(const VPositionData &data, std::atomic_bool *stop,
}
QList<VBestSquare> const results = watcher.future().results();
for (auto &result : results)
for (const auto &result : results)
{
bestResult.NewResult(result);
}

View File

@ -266,7 +266,7 @@ auto VPiece::PassmarksLines(const VContainer *data) const -> QVector<QLineF>
{
QVector<VPassmark> const passmarks = Passmarks(data);
QVector<QLineF> lines;
for (auto &passmark : passmarks)
for (const auto &passmark : passmarks)
{
if (not passmark.IsNull())
{
@ -1211,7 +1211,7 @@ auto VPiece::IsPassmarkVisible(const QVector<VPieceNode> &path, vsizetype passma
return true;
}
for (auto &record : records)
for (const auto &record : records)
{
if (record.includeType == PiecePathIncludeType::AsCustomSA)
{

View File

@ -842,7 +842,7 @@ auto VPiecePath::Edge(quint32 p1, quint32 p2) const -> vsizetype
auto VPiecePath::ListNodePoint() const -> QVector<VPieceNode>
{
QVector<VPieceNode> list;
for (auto &node : d->m_nodes) //-const V807
for (const auto &node : d->m_nodes) //-const V807
{
if (node.GetTypeTool() == Tool::NodePoint)
{

View File

@ -469,7 +469,7 @@ auto AbstractTest::CopyRecursively(const QString &srcFilePath, const QString &tg
QDir const sourceDir(srcFilePath);
const QStringList fileNames =
sourceDir.entryList(QDir::Files | QDir::Dirs | QDir::NoDotAndDotDot | QDir::Hidden | QDir::System);
for (auto &fileName : fileNames)
for (const auto &fileName : fileNames)
{
const QString newSrcFilePath = srcFilePath + QDir::separator() + fileName;
const QString newTgtFilePath = tgtFilePath + QDir::separator() + fileName;

View File

@ -333,7 +333,7 @@ void DialogFlippingByAxis::SuffixChanged()
{
QRegularExpression const rx(NameRegExp());
const QStringList uniqueNames = data->AllUniqueNames();
for (auto &uniqueName : uniqueNames)
for (const auto &uniqueName : uniqueNames)
{
const QString name = uniqueName + suffix;
if (not rx.match(name).hasMatch() || not data->IsUnique(name))

View File

@ -355,7 +355,7 @@ void DialogFlippingByLine::SuffixChanged()
{
QRegularExpression const rx(NameRegExp());
const QStringList uniqueNames = data->AllUniqueNames();
for (auto &uniqueName : uniqueNames)
for (const auto &uniqueName : uniqueNames)
{
const QString name = uniqueName + suffix;
if (not rx.match(name).hasMatch() || not data->IsUnique(name))

View File

@ -4864,7 +4864,7 @@ auto DialogSeamAllowance::GetDefaultPieceName() const -> QString
QList<VPiece> const pieces = data->DataPieces()->values();
QSet<QString> names;
for (auto &piece : pieces)
for (const auto &piece : pieces)
{
names.insert(piece.GetName());
}