diff options
author | Berthold Stoeger <bstoeger@mail.tuwien.ac.at> | 2018-11-04 15:19:29 +0100 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2018-11-04 08:04:27 -0800 |
commit | 83ed75f4ab7494bc4597246a8a50b9c54122843f (patch) | |
tree | 435b9f1198b36756235cf6f0a6d8873d25367265 | |
parent | a2b3d0ff0604fde45c1b2efe5fd8d0ca6c410e76 (diff) | |
download | subsurface-83ed75f4ab7494bc4597246a8a50b9c54122843f.tar.gz |
Dive list: use proper comparison when comparing dive to trip
The DiveTripModels are sorted in *reverse* chronological order.
Therefore, when comparing a dive against a trip, the dive has
to be inserted if the dive has a *later* date. Change the
comparison accordingly.
Reported-by: Jan Mulder <jlmulder@xs4all.nl>
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
-rw-r--r-- | qt-models/divetripmodel.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/qt-models/divetripmodel.cpp b/qt-models/divetripmodel.cpp index 33f0dd46c..7c86d6b73 100644 --- a/qt-models/divetripmodel.cpp +++ b/qt-models/divetripmodel.cpp @@ -753,9 +753,9 @@ void DiveTripModel::addDivesToTrip(int trip, const QVector<dive *> &dives) // before the trip in the case of equal timestamps. bool DiveTripModel::dive_before_entry(const dive *d, const Item &entry) { - // Dives at the same time come before trips, therefore use the "<=" operator. + // Dives at the same time come before trips, therefore use the ">=" operator. if (entry.trip) - return d->when <= entry.trip->when; + return d->when >= entry.trip->when; return !dive_less_than(d, entry.getDive()); } |