mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Core: add add_dive_to_table() function
Up to now, dives were added to the global dive table with add_single_dive(). Split out the funtionality to add a dive to an arbitrary dive in the add_dive_to_table_function(). The difference compared to record_dive_to_table is that dives are added at a specific position or the sort-criterion given by dive_less_than(). This will allow to use a dive tabe for trips instead of a linked list. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
parent
0618aa737f
commit
bc7afebc23
4 changed files with 30 additions and 20 deletions
|
@ -511,7 +511,7 @@ AddDive::AddDive(dive *d, bool autogroup, bool newNumber)
|
|||
allocTrip.reset(trip);
|
||||
}
|
||||
|
||||
int idx = dive_get_insertion_index(divePtr.get());
|
||||
int idx = dive_get_insertion_index(&dive_table, divePtr.get());
|
||||
if (newNumber)
|
||||
divePtr->number = get_dive_nr_at_idx(idx);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue