mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
core: replace list of dives in trip by std::vector<>
The dive_table will be converted into a table of owning pointers. Since the trip has only non-owning pointers to dives, turn its dive_table into an std::vector<dive *>. Add a helper functions to add/remove items in a sorted list. These could be used elsewhere. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
parent
71518fa77e
commit
5c7cfb1057
12 changed files with 107 additions and 86 deletions
|
|
@ -11,13 +11,15 @@ struct dive_trip
|
|||
{
|
||||
std::string location;
|
||||
std::string notes;
|
||||
struct dive_table dives = {};
|
||||
std::vector<dive *> dives;
|
||||
int id; /* unique ID for this trip: used to pass trips through QML. */
|
||||
/* Used by the io-routines to mark trips that have already been written. */
|
||||
bool saved = false;
|
||||
bool autogen = false;
|
||||
bool selected = false;
|
||||
|
||||
void sort_dives();
|
||||
|
||||
dive_trip();
|
||||
~dive_trip();
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue