core: introduce register_dive() function

There was a weird asymmetry, where the undo-commands would
register the fulltext index of the dive, but the core would
unregister the fulltext index in the "unregister_dive()"
function.

To make this more logical, create a "register_dive()" function
in core that does registers the fulltext index.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
Berthold Stoeger 2024-06-04 13:52:48 +02:00 committed by bstoeger
parent aa60e5d21d
commit b9df26066e
3 changed files with 21 additions and 12 deletions

View file

@ -3,6 +3,7 @@
#define DIVELIST_H
#include "units.h"
#include <memory>
#include <vector>
struct dive;
@ -56,6 +57,7 @@ void report_datafile_version(int version);
void clear_dive_file_data();
void clear_dive_table(struct dive_table *table);
struct dive *unregister_dive(int idx);
struct dive *register_dive(std::unique_ptr<dive> d);
extern bool has_dive(unsigned int deviceid, unsigned int diveid);
#endif // DIVELIST_H