core: make register_dive() member of dive_table

This one is for symmetry with unregister_dive(). However, it
makes me unhappy, because it modifies global state, namely the
selection machinery and the fulltext. I think these should be
moved up in the call chain.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
Berthold Stoeger 2024-06-18 21:19:14 +02:00 committed by bstoeger
parent 271df8962b
commit f3b8e3c4aa
3 changed files with 9 additions and 6 deletions

View file

@ -72,7 +72,7 @@ dive *DiveListBase::addDive(DiveToAdd &d)
d.site->add_dive(d.dive.get());
diveSiteCountChanged(d.site);
}
return register_dive(std::move(d.dive)); // Transfer ownership to core and update fulltext index
return divelog.dives.register_dive(std::move(d.dive)); // Transfer ownership to core and update fulltext index
}
// Some signals are sent in batches per trip. To avoid writing the same loop