profile: redo eventname handling

The eventname handling code was splattered all over the place.
Collect it in a single source file and use C++ idioms to avoid
nasty memory management. Provide a C-only interface, however.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
Berthold Stoeger 2023-02-12 15:51:39 +01:00 committed by Dirk Hohndel
parent ab7b9329c0
commit 0d3c9954f4
10 changed files with 94 additions and 70 deletions

View file

@ -2,6 +2,7 @@
#include "divecomputer.h"
#include "event.h"
#include "eventname.h"
#include "extradata.h"
#include "pref.h"
#include "sample.h"
@ -442,7 +443,7 @@ struct event *add_event(struct divecomputer *dc, unsigned int time, int type, in
add_event_to_dc(dc, ev);
remember_event(name);
remember_event_name(name);
return ev;
}