mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
core: move add_to_weightsystem_table() to weightsystem_table
Feels natural in a C++ code base. In analogy to other tables, this creates a struct that derives from std::vector<>. This is generally frowned upon, but it works and is the pragmatic thing for now. If someone wants to "fix" that, they may just do it. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
parent
498302dcc6
commit
650fda3221
4 changed files with 8 additions and 7 deletions
|
@ -1009,7 +1009,7 @@ RemoveWeight::RemoveWeight(int index, bool currentDiveOnly) :
|
|||
void RemoveWeight::undo()
|
||||
{
|
||||
for (size_t i = 0; i < dives.size(); ++i) {
|
||||
add_to_weightsystem_table(&dives[i]->weightsystems, indices[i], ws);
|
||||
dives[i]->weightsystems.add(indices[i], ws);
|
||||
emit diveListNotifier.weightAdded(dives[i], indices[i]);
|
||||
dives[i]->invalidate_cache(); // Ensure that dive is written in git_save()
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue