aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--desktop-widgets/command_divelist.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/desktop-widgets/command_divelist.cpp b/desktop-widgets/command_divelist.cpp
index d5fbc2139..2c474cf94 100644
--- a/desktop-widgets/command_divelist.cpp
+++ b/desktop-widgets/command_divelist.cpp
@@ -605,15 +605,17 @@ void ShiftTime::redoit()
// Changing times may have unsorted the dive table
sort_table(&dive_table);
- // We send one dives-deleted signal per trip (see comments in DiveListNotifier.h).
- // Therefore, collect all dives in a array and sort by trip.
+ // We send one time changed signal per trip (see comments in DiveListNotifier.h).
+ // Therefore, collect all dives in an array and sort by trip.
std::vector<std::pair<dive_trip *, dive *>> dives;
dives.reserve(diveList.size());
for (dive *d: diveList)
dives.push_back({ d->divetrip, d });
- // Send signals.
+ // Send signals and sort tables.
processByTrip(dives, [&](dive_trip *trip, const QVector<dive *> &divesInTrip) {
+ if (trip)
+ sort_table(&trip->dives); // Keep the trip-table in order
emit diveListNotifier.divesTimeChanged(trip, timeChanged, divesInTrip);
});