mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Cleanup: fix a few comments and debug messages
This is just minor fixes that are not user-visible: Fix a few erroneous comments and a debug message. These are copy & paste mistakes and mistakes introduced during code- refactoring. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
parent
0bc96905bf
commit
879f52180c
2 changed files with 2 additions and 6 deletions
|
@ -381,8 +381,7 @@ AddDive::AddDive(dive *d, bool autogroup, bool newNumber)
|
||||||
d->dc.maxdepth.mm = 0;
|
d->dc.maxdepth.mm = 0;
|
||||||
fixup_dive(d);
|
fixup_dive(d);
|
||||||
|
|
||||||
// Get an owning pointer to a copied or moved dive
|
// Get an owning pointer to a moved dive.
|
||||||
// Note: if move is true, this destroys the old dive!
|
|
||||||
OwningDivePtr divePtr(clone_dive(d));
|
OwningDivePtr divePtr(clone_dive(d));
|
||||||
divePtr->selected = false; // If we clone a planned dive, it might have been selected.
|
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
|
// We have to clear the flag, as selections will be managed
|
||||||
|
|
|
@ -733,8 +733,6 @@ void DiveTripModelTree::addDivesToTrip(int trip, const QVector<dive *> &dives)
|
||||||
// Construct the parent index, ie. the index of the trip.
|
// Construct the parent index, ie. the index of the trip.
|
||||||
QModelIndex parent = createIndex(trip, 0, noParent);
|
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,
|
addInBatches(items[trip].dives, dives,
|
||||||
[](dive *d, dive *d2) { return dive_less_than(d, d2); }, // comp
|
[](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
|
[&](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);
|
int diveIdx = findDiveInTrip(idx, current_dive);
|
||||||
if (diveIdx < 0) {
|
if (diveIdx < 0) {
|
||||||
// We don't know this dive. Something is wrong. Warn and bail.
|
// 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());
|
emit newCurrentDive(QModelIndex());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -1226,7 +1224,6 @@ void DiveTripModelList::currentDiveChanged()
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Either this is outside of a trip or we're in list mode.
|
|
||||||
auto it = std::find(items.begin(), items.end(), current_dive);
|
auto it = std::find(items.begin(), items.end(), current_dive);
|
||||||
if (it == items.end()) {
|
if (it == items.end()) {
|
||||||
// We don't know this dive. Something is wrong. Warn and bail.
|
// We don't know this dive. Something is wrong. Warn and bail.
|
||||||
|
|
Loading…
Add table
Reference in a new issue