summaryrefslogtreecommitdiffstats
path: root/desktop-widgets/command_divelist.cpp
diff options
context:
space:
mode:
authorGravatar Berthold Stoeger <bstoeger@mail.tuwien.ac.at>2018-11-08 14:02:36 +0100
committerGravatar Dirk Hohndel <dirk@hohndel.org>2018-11-18 16:50:09 -0800
commitbc7afebc23477ef23f2b9741bf45b2180cbafe15 (patch)
treefbb52713f0d9b74f6db70b50ead1fa781a61f7e4 /desktop-widgets/command_divelist.cpp
parent0618aa737fde54e634d16273ec0246ced9c454aa (diff)
downloadsubsurface-bc7afebc23477ef23f2b9741bf45b2180cbafe15.tar.gz
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>
Diffstat (limited to 'desktop-widgets/command_divelist.cpp')
-rw-r--r--desktop-widgets/command_divelist.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/desktop-widgets/command_divelist.cpp b/desktop-widgets/command_divelist.cpp
index 9f4ea8cd2..3d1aae2e7 100644
--- a/desktop-widgets/command_divelist.cpp
+++ b/desktop-widgets/command_divelist.cpp
@@ -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);