mirror of
https://github.com/subsurface/subsurface.git
synced 2025-01-19 14:25:27 +00:00
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>
This commit is contained in:
parent
a2b3d0ff06
commit
83ed75f4ab
1 changed files with 2 additions and 2 deletions
|
@ -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());
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue