Core: turn add_single_dive() to append_dive()

The only external caller of add_single_dive() used it to append a
dive to the global dive list. Rename the function accordingly and
remove the index parameter.

The internal caller can use the local insert_dive() function, which
doesn't consider selection. That shouldn't be a problem, as the
caller is doing import.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
Berthold Stoeger 2019-04-14 15:37:19 +02:00 committed by Dirk Hohndel
parent 5729f93e1f
commit 88dc32fdfc
3 changed files with 15 additions and 20 deletions

View file

@ -278,7 +278,7 @@ QString DiveListModel::startAddDive()
nr++;
d->number = nr;
d->dc.model = strdup("manually added dive");
add_single_dive(dive_table.nr, d);
append_dive(d);
insertDive(get_idx_by_uniq_id(d->id), new DiveObjectHelper(d));
return QString::number(d->id);
}