From 31eb86c73365deefc2bcf51f7ad86bf4ba314379 Mon Sep 17 00:00:00 2001 From: Berthold Stoeger Date: Thu, 10 Jan 2019 17:07:03 +0200 Subject: Dive import: fix logic of process_imported_dives() The logic in process_imported_dives() was faulty: Dives are merged trip-wise in a loop. But if only autogenerated trips were supposed to be merged, the trip would not be added. Change the logic to always add the trip if it is not merged. To make the loop easier to read, factor out the merge-trip-into-existing-trips logic into a separate function. Signed-off-by: Berthold Stoeger --- desktop-widgets/command_divelist.cpp | 1 - 1 file changed, 1 deletion(-) (limited to 'desktop-widgets') diff --git a/desktop-widgets/command_divelist.cpp b/desktop-widgets/command_divelist.cpp index 6ab7ec099..4e985cf28 100644 --- a/desktop-widgets/command_divelist.cpp +++ b/desktop-widgets/command_divelist.cpp @@ -40,7 +40,6 @@ void processByTrip(std::vector> &dives, Function } } - // This helper function removes a dive, takes ownership of the dive and adds it to a DiveToAdd structure. // If the trip the dive belongs to becomes empty, it is removed and added to the tripsToAdd vector. // It is crucial that dives are added in reverse order of deletion, so that the indices are correctly -- cgit v1.2.3-70-g09d2