Mobile: use a default weight name when adding weight system

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Dirk Hohndel 2019-08-11 09:11:06 -07:00
parent 6b92edc9ab
commit 0eb14828b5

View file

@ -1045,8 +1045,8 @@ void QMLManager::commitChanges(QString diveId, QString date, QString location, Q
// 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) } , "" };
add_cloned_weightsystem(&d->weightsystems, ws);
weightsystem_t ws = { { parseWeightToGrams(weight) } , strdup(qPrintable(tr("weight"))) };
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);
}