Lint: fix several issues discovered by clazy

This commit is contained in:
wmayer
2023-08-18 00:49:06 +02:00
committed by Chris Hennes
parent d69551eccb
commit ff1981fcdc
4 changed files with 9 additions and 10 deletions

View File

@@ -399,11 +399,11 @@ void Document::exportGraphviz(std::ostream& out) const
}
// Internal document objects
for (auto It : d->objectMap)
for (const auto & It : d->objectMap)
addExpressionSubgraphIfNeeded(It.second, CSSubgraphs);
// Add external document objects
for (auto it : d->objectMap) {
for (const auto & it : d->objectMap) {
std::vector<DocumentObject*> OutList = it.second->getOutList();
for (auto obj : OutList) {
if (obj) {
@@ -424,11 +424,11 @@ void Document::exportGraphviz(std::ostream& out) const
bool CSSubgraphs = depGrp->GetBool("GeoFeatureSubgraphs", true);
// Add internal document objects
for (auto It : d->objectMap)
for (const auto & It : d->objectMap)
add(It.second, It.second->getNameInDocument(), It.second->Label.getValue(), CSSubgraphs);
// Add external document objects
for (auto It : d->objectMap) {
for (const auto & It : d->objectMap) {
std::vector<DocumentObject*> OutList = It.second->getOutList();
for (auto obj : OutList) {
if (obj) {
@@ -484,7 +484,7 @@ void Document::exportGraphviz(std::ostream& out) const
bool omitGeoFeatureGroups = depGrp->GetBool("GeoFeatureSubgraphs", true);
// Add edges between document objects
for (auto It : d->objectMap) {
for (const auto & It : d->objectMap) {
if(omitGeoFeatureGroups) {
//coordinate systems are represented by subgraphs

View File

@@ -842,7 +842,6 @@ struct EulerSequence_Parameters
EulerSequence_Parameters translateEulerSequence (const Rotation::EulerSequence theSeq)
{
using Params = EulerSequence_Parameters;
const bool F = false;
const bool T = true;

View File

@@ -489,7 +489,7 @@ void DocumentModel::slotChangeObject(const Gui::ViewProviderDocumentObject& obj,
auto doc_index = static_cast<DocumentIndex*>(d->rootItem->child(row));
QList<ViewProviderIndex*> views;
doc_index->findViewProviders(obj, views);
for (const auto & view : views) {
for (const auto & view : qAsConst(views)) {
DocumentModelIndex* parentitem = view->parent();
QModelIndex parent = createIndex(0,0,parentitem);
int row = view->row();
@@ -523,7 +523,7 @@ void DocumentModel::slotChangeObject(const Gui::ViewProviderDocumentObject& obj,
// get all occurrences of the view provider in the tree structure
QList<ViewProviderIndex*> obj_index;
doc_index->findViewProviders(obj, obj_index);
for (const auto & it : obj_index) {
for (const auto & it : qAsConst(obj_index)) {
QModelIndex parent = createIndex(it->row(),0,it);
int count_obj = it->childCount();
beginRemoveRows(parent, 0, count_obj);

View File

@@ -382,7 +382,7 @@ public:
~NotificationsAction() override
{
for (auto* item : pushedItems) {
for (auto* item : qAsConst(pushedItems)) {
if (item) {
delete item;
}
@@ -572,7 +572,7 @@ protected:
QMenu menu;
QAction* del = menu.addAction(tr("Delete"), this, [&]() {
for (auto it : selectedItems) {
for (auto it : qAsConst(selectedItems)) {
delete it;
}
});