mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
core: convert taxonomy.c to C++
Since the taxonomy is now a real C++ struct with constructor and destructor, dive_site has to be converted to C++ as well. A bit hairy for now, but will ultimately be distinctly simpler. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
parent
3c1401785b
commit
3f8b4604be
39 changed files with 259 additions and 336 deletions
|
@ -125,7 +125,7 @@ DivesAndTripsToAdd DiveListBase::removeDives(DivesAndSitesToRemove &divesAndSite
|
|||
{
|
||||
std::vector<DiveToAdd> divesToAdd;
|
||||
std::vector<OwningTripPtr> tripsToAdd;
|
||||
std::vector<OwningDiveSitePtr> sitesToAdd;
|
||||
std::vector<std::unique_ptr<dive_site>> sitesToAdd;
|
||||
divesToAdd.reserve(divesAndSitesToDelete.dives.size());
|
||||
sitesToAdd.reserve(divesAndSitesToDelete.sites.size());
|
||||
|
||||
|
@ -216,7 +216,7 @@ DivesAndSitesToRemove DiveListBase::addDives(DivesAndTripsToAdd &toAdd)
|
|||
toAdd.trips.clear();
|
||||
|
||||
// Finally, add any necessary dive sites
|
||||
for (OwningDiveSitePtr &ds: toAdd.sites) {
|
||||
for (std::unique_ptr<dive_site> &ds: toAdd.sites) {
|
||||
sites.push_back(ds.get());
|
||||
int idx = register_dive_site(ds.release()); // Return ownership to backend
|
||||
emit diveListNotifier.diveSiteAdded(sites.back(), idx);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue