From 145f70aab59a5ebd1b4ca82432caf38b4821b055 Mon Sep 17 00:00:00 2001 From: Berthold Stoeger Date: Sun, 31 Mar 2019 10:20:13 +0200 Subject: Undo: implement split-out of dive computer Allow splitting out a dive computer into a distinct dive. This is realized by generating a base class from SplitDive. This turned out to be more cumbersome than expected: we don't know a-priori which of the split dives will come first. Since the undo-command saves the indices where the dives will be insert, these have to be calculated. This is an premature optimization, which makes more pain than necessary. Let's remove it and simply determine the insertion index when executing the command. Original code by Linus Torvalds . Signed-off-by: Berthold Stoeger Signed-off-by: Dirk Hohndel --- desktop-widgets/command.h | 1 + 1 file changed, 1 insertion(+) (limited to 'desktop-widgets/command.h') diff --git a/desktop-widgets/command.h b/desktop-widgets/command.h index d527fff3b..4c6240a93 100644 --- a/desktop-widgets/command.h +++ b/desktop-widgets/command.h @@ -32,6 +32,7 @@ void createTrip(const QVector &divesToAddIn); void autogroupDives(); void mergeTrips(dive_trip *trip1, dive_trip *trip2); void splitDives(dive *d, duration_t time); +void splitDiveComputer(dive *d, int dc_num); void mergeDives(const QVector &dives); } // namespace Command -- cgit v1.2.3-70-g09d2