mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
core: turn string data in struct divecomputer into std::string
Simplifies memory management. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
parent
cc39f709ce
commit
b9a2eff3c9
28 changed files with 114 additions and 147 deletions
|
@ -178,9 +178,9 @@ void dc_settings_start(struct parser_state *state)
|
|||
void dc_settings_end(struct parser_state *state)
|
||||
{
|
||||
create_device_node(state->log->devices.get(),
|
||||
state->cur_settings.dc.model.c_str(),
|
||||
state->cur_settings.dc.serial_nr.c_str(),
|
||||
state->cur_settings.dc.nickname.c_str());
|
||||
state->cur_settings.dc.model,
|
||||
state->cur_settings.dc.serial_nr,
|
||||
state->cur_settings.dc.nickname);
|
||||
reset_dc_settings(state);
|
||||
}
|
||||
|
||||
|
@ -392,7 +392,7 @@ void divecomputer_start(struct parser_state *state)
|
|||
dc = dc->next;
|
||||
|
||||
/* Did we already fill that in? */
|
||||
if (dc->samples || dc->model || dc->when) {
|
||||
if (dc->samples || !dc->model.empty() || dc->when) {
|
||||
struct divecomputer *newdc = new divecomputer;
|
||||
if (newdc) {
|
||||
dc->next = newdc;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue