core: move get_dive_location()/_country() to struct dive

Feels natural in a C++ code base.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
Berthold Stoeger 2024-06-30 20:55:34 +02:00 committed by bstoeger
parent f1f082d86a
commit 76d672210d
9 changed files with 18 additions and 21 deletions

View file

@ -60,7 +60,7 @@ struct dive_trip *unregister_dive_from_trip(struct dive *dive)
std::unique_ptr<dive_trip> create_trip_from_dive(const struct dive *dive)
{
auto trip = std::make_unique<dive_trip>();
trip->location = get_dive_location(dive);
trip->location = dive->get_location();
return trip;
}
@ -162,7 +162,7 @@ std::vector<dives_to_autogroup_result> get_dives_to_autogroup(const struct dive_
dive->when >= lastdive->when + TRIP_THRESHOLD)
break;
if (trip->location.empty())
trip->location = get_dive_location(dive.get());
trip->location = dive->get_location();
lastdive = dive.get();
}
res.push_back({ i, to, trip, std::move(allocated) });