mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
core: move functions into trip-structure
Not strictly necessary, but a "natural" thing to do in a classical C++ code base. Move the tiny trip-table into its own source file, since it also has its own header. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
parent
67d0f69516
commit
7792f54a73
16 changed files with 78 additions and 75 deletions
|
@ -67,7 +67,7 @@ void DiveListBase::diveSiteCountChanged(struct dive_site *ds)
|
|||
dive *DiveListBase::addDive(DiveToAdd &d)
|
||||
{
|
||||
if (d.trip)
|
||||
add_dive_to_trip(d.dive.get(), d.trip);
|
||||
d.trip->add_dive(d.dive.get());
|
||||
if (d.site) {
|
||||
d.site->add_dive(d.dive.get());
|
||||
diveSiteCountChanged(d.site);
|
||||
|
@ -267,7 +267,7 @@ static std::unique_ptr<dive_trip> moveDiveToTrip(DiveToTrip &diveToTrip)
|
|||
// Store old trip and get new trip we should associate this dive with
|
||||
std::swap(trip, diveToTrip.trip);
|
||||
if (trip)
|
||||
add_dive_to_trip(diveToTrip.dive, trip);
|
||||
trip->add_dive(diveToTrip.dive);
|
||||
invalidate_dive_cache(diveToTrip.dive); // Ensure that dive is written in git_save()
|
||||
return res;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue