core: remove autogroup global

Use the flag in the divelog structure, since this will be saved
in the dive log.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
Berthold Stoeger 2022-11-12 09:14:00 +01:00 committed by bstoeger
parent aa34afc3f7
commit b61732da42
10 changed files with 23 additions and 29 deletions

View file

@ -690,13 +690,13 @@ static void eventtime(char *buffer, duration_t *duration, struct parser_state *s
duration->seconds += state->cur_sample->time.seconds;
}
static void try_to_match_autogroup(const char *name, char *buf)
static void try_to_match_autogroup(const char *name, char *buf, struct parser_state *state)
{
bool autogroupvalue;
bool autogroup;
start_match("autogroup", name, buf);
if (MATCH("state.autogroup", get_bool, &autogroupvalue)) {
set_autogroup(autogroupvalue);
if (MATCH("state.autogroup", get_bool, &autogroup)) {
state->log->autogroup = autogroup;
return;
}
nonmatch("autogroup", name, buf);
@ -1503,7 +1503,7 @@ static bool entry(const char *name, char *buf, struct parser_state *state)
if (state->in_settings) {
try_to_fill_fingerprint(name, buf, state);
try_to_fill_dc_settings(name, buf, state);
try_to_match_autogroup(name, buf);
try_to_match_autogroup(name, buf, state);
return true;
}
if (state->cur_dive_site) {