Dive list: update position of trip if data changed

If the date of a dive changed, it might be necessary to reorder
the trips, as the date of the trip changed. Although this seems
like an odd usecase, move the trip if necessary, for consistency's
sake.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
Berthold Stoeger 2018-11-13 09:26:53 +01:00 committed by Dirk Hohndel
parent 64e6e435f8
commit 911edfca71
2 changed files with 39 additions and 7 deletions

View file

@ -115,6 +115,7 @@ private:
// Addition and deletion of dives
void addDivesToTrip(int idx, const QVector<dive *> &dives);
void topLevelChanged(int idx);
dive *diveOrNull(const QModelIndex &index) const; // Returns a dive if this index represents a dive, null otherwise
dive_or_trip tripOrDive(const QModelIndex &index) const;