diff options
-rw-r--r-- | desktop-widgets/command_divelist.cpp | 3 | ||||
-rw-r--r-- | qt-models/divetripmodel.cpp | 5 |
2 files changed, 2 insertions, 6 deletions
diff --git a/desktop-widgets/command_divelist.cpp b/desktop-widgets/command_divelist.cpp index eb3de65cd..ddc3d11ce 100644 --- a/desktop-widgets/command_divelist.cpp +++ b/desktop-widgets/command_divelist.cpp @@ -381,8 +381,7 @@ AddDive::AddDive(dive *d, bool autogroup, bool newNumber) d->dc.maxdepth.mm = 0; fixup_dive(d); - // Get an owning pointer to a copied or moved dive - // Note: if move is true, this destroys the old dive! + // Get an owning pointer to a moved dive. OwningDivePtr divePtr(clone_dive(d)); divePtr->selected = false; // If we clone a planned dive, it might have been selected. // We have to clear the flag, as selections will be managed diff --git a/qt-models/divetripmodel.cpp b/qt-models/divetripmodel.cpp index dd871d80d..59069164f 100644 --- a/qt-models/divetripmodel.cpp +++ b/qt-models/divetripmodel.cpp @@ -733,8 +733,6 @@ void DiveTripModelTree::addDivesToTrip(int trip, const QVector<dive *> &dives) // 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 @@ -1061,7 +1059,7 @@ void DiveTripModelTree::currentDiveChanged() int diveIdx = findDiveInTrip(idx, current_dive); if (diveIdx < 0) { // We don't know this dive. Something is wrong. Warn and bail. - qWarning() << "DiveTripModelTree::currentDiveChanged(): unknown top-level dive"; + qWarning() << "DiveTripModelTree::currentDiveChanged(): unknown dive"; emit newCurrentDive(QModelIndex()); return; } @@ -1226,7 +1224,6 @@ void DiveTripModelList::currentDiveChanged() return; } - // Either this is outside of a trip or we're in list mode. auto it = std::find(items.begin(), items.end(), current_dive); if (it == items.end()) { // We don't know this dive. Something is wrong. Warn and bail. |