mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Mobile: support editing of dives with no weightsystem
If a dive has no weightsystems, editing the weight system has to add a new entry in the table. Implement that. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
parent
75be9e727d
commit
6b92edc9ab
1 changed files with 8 additions and 5 deletions
|
@ -1040,11 +1040,14 @@ void QMLManager::commitChanges(QString diveId, QString date, QString location, Q
|
||||||
diveChanged = true;
|
diveChanged = true;
|
||||||
d->watertemp.mkelvin = parseTemperatureToMkelvin(watertemp);
|
d->watertemp.mkelvin = parseTemperatureToMkelvin(watertemp);
|
||||||
}
|
}
|
||||||
// not sure what we'd do if there was more than one weight system
|
if (myDive->sumWeight() != weight) {
|
||||||
// defined - for now just ignore that case
|
diveChanged = true;
|
||||||
if (d->weightsystems.nr == 1) {
|
// not sure what we'd do if there was more than one weight system
|
||||||
if (myDive->sumWeight() != weight) {
|
// defined - for now just ignore that case
|
||||||
diveChanged = true;
|
if (d->weightsystems.nr == 0) {
|
||||||
|
weightsystem_t ws = { { parseWeightToGrams(weight) } , "" };
|
||||||
|
add_cloned_weightsystem(&d->weightsystems, ws);
|
||||||
|
} else if (d->weightsystems.nr == 1) {
|
||||||
d->weightsystems.weightsystems[0].weight.grams = parseWeightToGrams(weight);
|
d->weightsystems.weightsystems[0].weight.grams = parseWeightToGrams(weight);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue