Cleanup: remove bogus mark_divelist_changed() calls

The parsers / downloaders parse into a separate table and do
not directly change the divelist. Therefore, they shouldn't
call mark_divelist_changed().

Likewise split_dive_at() doesn't modify the dive list and
therefore shouldn't call this function.

Calling the function has the unwanted side-effect that undoing
the change will not clear the *-symbol in the title of the
main window.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
Berthold Stoeger 2019-07-17 15:58:26 +02:00 committed by Dirk Hohndel
parent 726d08c2f7
commit 94521c9958
6 changed files with 0 additions and 8 deletions

View file

@ -787,7 +787,6 @@ static void cochran_parse_dive(const unsigned char *decode, unsigned mod,
}
record_dive_to_table(dive, table);
mark_divelist_changed(true);
free(buf);
}

View file

@ -3195,8 +3195,6 @@ static int split_dive_at(const struct dive *dive, int a, int b, struct dive **ou
d2->number = 0;
}
mark_divelist_changed(true);
*out1 = d1;
*out2 = d2;
return nr;

View file

@ -826,7 +826,6 @@ static int dive_cb(const unsigned char *data, unsigned int size,
}
record_dive_to_table(dive, devdata->download_table);
mark_divelist_changed(true);
return true;
error_exit:

View file

@ -424,7 +424,6 @@ static void parse_dives(int log_version, const unsigned char *buf, unsigned int
// End dive
record_dive_to_table(dive, table);
dive = NULL;
mark_divelist_changed(true);
// Advance ptr for next dive
ptr += ps_ptr + 4;

View file

@ -190,7 +190,6 @@ void ostctools_import(const char *file, struct dive_table *divetable, struct tri
add_extra_data(&ostcdive->dc, "Serial", ostcdive->dc.serial);
}
record_dive_to_table(ostcdive, divetable);
mark_divelist_changed(true);
sort_dive_table(divetable);
close_out:

View file

@ -1018,14 +1018,12 @@ static bool process_raw_buffer(device_data_t *devdata, uint32_t deviceid, char *
if (done && ++bp < endptr && *bp != '{' && strstr(bp, "{{")) {
done = false;
record_dive_to_table(dive, devdata->download_table);
mark_divelist_changed(true);
dive = uemis_start_dive(deviceid);
}
}
if (is_log) {
if (dive->dc.diveid) {
record_dive_to_table(dive, devdata->download_table);
mark_divelist_changed(true);
} else { /* partial dive */
free(dive);
free(buf);