From f6957c54afaa58eab0b57127ac1f31389dfd35e1 Mon Sep 17 00:00:00 2001 From: Berthold Stoeger Date: Wed, 27 Feb 2019 23:10:24 +0100 Subject: Autogroup: make notrip flag work again. 6bf4120dbbf7be1b9267e0e86f3948b77870ea71 replaced the trip flag by a notrip boolean. This was supposed to signal that the user removed the dive from a trip and therefore it shouldn't be autogrouped again. Sadly, the commit removed the feature. Reinstate it. Signed-off-by: Berthold Stoeger --- desktop-widgets/command_divelist.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/desktop-widgets/command_divelist.cpp b/desktop-widgets/command_divelist.cpp index f45202aa9..845afac75 100644 --- a/desktop-widgets/command_divelist.cpp +++ b/desktop-widgets/command_divelist.cpp @@ -754,8 +754,12 @@ RemoveDivesFromTrip::RemoveDivesFromTrip(const QVector &divesToRemove) { setText(tr("remove %n dive(s) from trip", "", divesToRemove.size())); divesToMove.divesToMove.reserve(divesToRemove.size()); - for (dive *d: divesToRemove) + for (dive *d: divesToRemove) { + // If a user manually removes a dive from a trip, don't autogroup this dive. + // The flag will not be reset on undo, but that should be acceptable. + d->notrip = true; divesToMove.divesToMove.push_back( {d, nullptr} ); + } } RemoveAutogenTrips::RemoveAutogenTrips() -- cgit v1.2.3-70-g09d2