diff options
author | Berthold Stoeger <bstoeger@mail.tuwien.ac.at> | 2019-01-10 17:07:03 +0200 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2019-01-19 13:48:17 -0800 |
commit | 31eb86c73365deefc2bcf51f7ad86bf4ba314379 (patch) | |
tree | c09b330d97bb45ca175f987674bb8797f110cb7a /desktop-widgets/command_divelist.cpp | |
parent | 11d19abc7412b76c9ee1be39ffe992afb02b710b (diff) | |
download | subsurface-31eb86c73365deefc2bcf51f7ad86bf4ba314379.tar.gz |
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 <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'desktop-widgets/command_divelist.cpp')
-rw-r--r-- | desktop-widgets/command_divelist.cpp | 1 |
1 files changed, 0 insertions, 1 deletions
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<std::pair<dive_trip *, dive *>> &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 |