mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Create UUID when adding a dive site to core
3f8b4604be
introduced a bug: it replaced alloc_dive_site() by the
divesite constructor. However, the latter does not generate a
UUID (for that it would have to access the dive site table).
Thus newly added dive sites had no UUID and could not be saved
properly.
Use the register_site() instead of the put() function when
adding the dive site to the core, so that the UUID is created
if needed.
This needs an audit.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
parent
e0d1a54aef
commit
6f367c70b7
1 changed files with 1 additions and 1 deletions
|
@ -30,7 +30,7 @@ static std::vector<dive_site *> addDiveSites(std::vector<std::unique_ptr<dive_si
|
|||
}
|
||||
|
||||
// Add dive site to core, but remember a non-owning pointer first.
|
||||
auto add_res = divelog.sites.put(std::move(ds)); // Return ownership to backend.
|
||||
auto add_res = divelog.sites.register_site(std::move(ds)); // Return ownership to backend.
|
||||
res.push_back(add_res.ptr);
|
||||
emit diveListNotifier.diveSiteAdded(res.back(), add_res.idx); // Inform frontend of new dive site.
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue