mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
core: convert weightsystem_t and weightsystem_table to C++
As for cylinders, this had to be done simultaneously, Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
parent
28520da655
commit
640ecb345b
28 changed files with 137 additions and 247 deletions
|
@ -1228,11 +1228,11 @@ void QMLManager::commitChanges(QString diveId, QString number, QString date, QSt
|
|||
diveChanged = true;
|
||||
// not sure what we'd do if there was more than one weight system
|
||||
// defined - for now just ignore that case
|
||||
if (d->weightsystems.nr == 0) {
|
||||
weightsystem_t ws = { { parseWeightToGrams(weight) } , strdup(qPrintable(tr("weight"))), false };
|
||||
add_to_weightsystem_table(&d->weightsystems, 0, ws); // takes ownership of the string
|
||||
} else if (d->weightsystems.nr == 1) {
|
||||
d->weightsystems.weightsystems[0].weight.grams = parseWeightToGrams(weight);
|
||||
if (d->weightsystems.size() == 0) {
|
||||
weightsystem_t ws = { { parseWeightToGrams(weight) } , tr("weight").toStdString(), false };
|
||||
add_to_weightsystem_table(&d->weightsystems, 0, std::move(ws));
|
||||
} else if (d->weightsystems.size() == 1) {
|
||||
d->weightsystems[0].weight.grams = parseWeightToGrams(weight);
|
||||
}
|
||||
}
|
||||
// start and end pressures
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue