From 285fa8acbceebf5dc87c5c3befe42a2917a3b844 Mon Sep 17 00:00:00 2001 From: "Robert C. Helling" Date: Wed, 11 Mar 2020 11:30:51 +0100 Subject: Grammar: replaces 'indexes' by 'indices' Grammar-nazi ran git grep -l 'indexes' | xargs sed -i '' -e 's/indexes/indices/g' to prevent future wincing when reading the source code. Unfortunatly, Qt itself is infected as in QModelIndexList QItemSelection::indexes() const Signed-off-by: Robert C. Helling --- commands/command_edit.cpp | 18 +++++++++--------- commands/command_edit.h | 2 +- 2 files changed, 10 insertions(+), 10 deletions(-) (limited to 'commands') diff --git a/commands/command_edit.cpp b/commands/command_edit.cpp index 753c67891..6a5e165be 100644 --- a/commands/command_edit.cpp +++ b/commands/command_edit.cpp @@ -1041,18 +1041,18 @@ EditWeightBase::EditWeightBase(int index, bool currentDiveOnly) : // For that purpose, we will determine the indices of the same weightsystem. std::vector divesNew; divesNew.reserve(dives.size()); - indexes.reserve(dives.size()); + indices.reserve(dives.size()); for (dive *d: dives) { if (d == current) { divesNew.push_back(d); - indexes.push_back(index); + indices.push_back(index); continue; } int idx = find_weightsystem_index(d, ws); if (idx >= 0) { divesNew.push_back(d); - indexes.push_back(idx); + indices.push_back(idx); } } dives = std::move(divesNew); @@ -1081,16 +1081,16 @@ RemoveWeight::RemoveWeight(int index, bool currentDiveOnly) : void RemoveWeight::undo() { for (size_t i = 0; i < dives.size(); ++i) { - add_to_weightsystem_table(&dives[i]->weightsystems, indexes[i], clone_weightsystem(ws)); - emit diveListNotifier.weightAdded(dives[i], indexes[i]); + add_to_weightsystem_table(&dives[i]->weightsystems, indices[i], clone_weightsystem(ws)); + emit diveListNotifier.weightAdded(dives[i], indices[i]); } } void RemoveWeight::redo() { for (size_t i = 0; i < dives.size(); ++i) { - remove_weightsystem(dives[i], indexes[i]); - emit diveListNotifier.weightRemoved(dives[i], indexes[i]); + remove_weightsystem(dives[i], indices[i]); + emit diveListNotifier.weightRemoved(dives[i], indices[i]); } } @@ -1138,8 +1138,8 @@ EditWeight::~EditWeight() void EditWeight::redo() { for (size_t i = 0; i < dives.size(); ++i) { - set_weightsystem(dives[i], indexes[i], new_ws); - emit diveListNotifier.weightEdited(dives[i], indexes[i]); + set_weightsystem(dives[i], indices[i], new_ws); + emit diveListNotifier.weightEdited(dives[i], indices[i]); } std::swap(ws, new_ws); } diff --git a/commands/command_edit.h b/commands/command_edit.h index aeecc0bab..6a5b8230f 100644 --- a/commands/command_edit.h +++ b/commands/command_edit.h @@ -353,7 +353,7 @@ protected: ~EditWeightBase(); weightsystem_t ws; - std::vector indexes; // An index for each dive in the dives vector. + std::vector indices; // An index for each dive in the dives vector. bool workToBeDone() override; }; -- cgit v1.2.3-70-g09d2