Dive list: add table parameter to autogroup_dives()

Currently autogroup_dives() groups all dives in the global dive
list. Add a table parameter so that dives in any table can be
grouped. Thus it will be possible to pre-group dives on import,
which will be used for undo of import.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
Berthold Stoeger 2018-11-24 07:50:13 +01:00 committed by Dirk Hohndel
parent f8327ed51b
commit 825fcc8547
3 changed files with 15 additions and 13 deletions

View file

@ -724,7 +724,7 @@ AutogroupDives::AutogroupDives()
dive_trip *trip;
bool alloc;
int from, to;
for(int i = 0; (trip = get_dives_to_autogroup(i, &from, &to, &alloc)) != NULL; i = to) {
for(int i = 0; (trip = get_dives_to_autogroup(&dive_table, i, &from, &to, &alloc)) != NULL; i = to) {
// If this is an allocated trip, take ownership
if (alloc)
divesToMove.tripsToAdd.emplace_back(trip);