core: read and write the user-specified salinity

Both XML and git storage are added.

Signed-off-by: willemferguson <willemferguson@zoology.up.ac.za>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
willemferguson 2019-11-19 19:16:45 +02:00 committed by Dirk Hohndel
parent ebabbfb457
commit d2cf58e07e
10 changed files with 62 additions and 18 deletions

View file

@ -355,6 +355,27 @@ DiveField EditWaterTemp::fieldId() const
return DiveField::WATER_TEMP;
}
// ***** Water Type *****
void EditWaterTypeUser::set(struct dive *d, int value) const
{
d->user_salinity = value > 0 ? value : 0;
}
int EditWaterTypeUser::data(struct dive *d) const
{
return d->user_salinity;
}
QString EditWaterTypeUser::fieldName() const
{
return tr("salinity");
}
DiveField EditWaterTypeUser::fieldId() const
{
return DiveField::SALINITY;
}
// ***** Atmospheric pressure *****
void EditAtmPress::set(struct dive *d, int value) const
{