Coding style: fix indentation in addDivesToTrip()

addDivesToTrip() had one level of indentation too much owing
to a copy-and-paste error. Remove.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
Berthold Stoeger 2018-11-10 13:02:46 +01:00 committed by Dirk Hohndel
parent 243962a67a
commit 431b2bb845

View file

@ -726,18 +726,18 @@ void addInBatches(Vector1 &v1, const Vector2 &v2, Comparator comp, Inserter inse
void DiveTripModel::addDivesToTrip(int trip, const QVector<dive *> &dives)
{
// Construct the parent index, ie. the index of the trip.
QModelIndex parent = createIndex(trip, 0, noParent);
// Construct the parent index, ie. the index of the trip.
QModelIndex parent = createIndex(trip, 0, noParent);
// Either this is outside of a trip or we're in list mode.
// Thus, add dives at the top-level in batches
addInBatches(items[trip].dives, dives,
[](dive *d, dive *d2) { return dive_less_than(d, d2); }, // comp
[&](std::vector<dive *> &items, const QVector<dive *> &dives, int idx, int from, int to) { // inserter
beginInsertRows(parent, idx, idx + to - from - 1);
items.insert(items.begin() + idx, dives.begin() + from, dives.begin() + to);
endInsertRows();
});
// Either this is outside of a trip or we're in list mode.
// Thus, add dives at the top-level in batches
addInBatches(items[trip].dives, dives,
[](dive *d, dive *d2) { return dive_less_than(d, d2); }, // comp
[&](std::vector<dive *> &items, const QVector<dive *> &dives, int idx, int from, int to) { // inserter
beginInsertRows(parent, idx, idx + to - from - 1);
items.insert(items.begin() + idx, dives.begin() + from, dives.begin() + to);
endInsertRows();
});
}
// This function is used to compare a dive to an arbitrary entry (dive or trip).