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
|
@ -1228,7 +1228,7 @@ void QMLManager::commitChanges(QString diveId, QString number, QString date, QSt
|
|||
// defined - for now just ignore that case
|
||||
if (d->weightsystems.size() == 0) {
|
||||
weightsystem_t ws = { { parseWeightToGrams(weight) } , tr("weight").toStdString(), false };
|
||||
add_to_weightsystem_table(&d->weightsystems, 0, std::move(ws));
|
||||
d->weightsystems.add(0, std::move(ws));
|
||||
} else if (d->weightsystems.size() == 1) {
|
||||
d->weightsystems[0].weight.grams = parseWeightToGrams(weight);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue