core: move dive-site functions into class

In analogy to the previous commit for dive-site-table.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
Berthold Stoeger 2024-05-11 15:01:37 +02:00 committed by bstoeger
parent 76c52c87a3
commit 2de6f69c19
20 changed files with 69 additions and 71 deletions

View file

@ -344,7 +344,7 @@ void MergeDiveSites::redo()
// the dives in the sitesToAdd vector.
for (const std::unique_ptr<dive_site> &site: sitesToAdd) {
for (dive *d: site->dives) {
add_dive_to_dive_site(d, ds);
ds->add_dive(d);
divesChanged.push_back(d);
}
}
@ -385,7 +385,7 @@ ApplyGPSFixes::ApplyGPSFixes(const std::vector<DiveAndLocation> &fixes)
} else {
ds = divelog.sites->create(dl.name.toStdString());
ds->location = dl.location;
add_dive_to_dive_site(dl.d, ds);
ds->add_dive(dl.d);
dl.d->dive_site = nullptr; // This will be set on redo()
sitesToAdd.emplace_back(ds);
}