mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Grantlee: Add salinity and water type to grantlee variables
These can be useful in a printed divelog, especially if the log entry is also showing weight and exposure suit. Signed-off-by: Monty Taylor <mordred@inaugust.com>
This commit is contained in:
parent
b3270222fd
commit
95e6792c4f
9 changed files with 56 additions and 20 deletions
|
@ -249,6 +249,19 @@ QStringList getFullCylinderList()
|
|||
return cylinders;
|
||||
}
|
||||
|
||||
QString formatDiveSalinity(const dive *d)
|
||||
{
|
||||
int salinity = get_dive_salinity(d);
|
||||
if (!salinity)
|
||||
return QString();
|
||||
return get_salinity_string(salinity);
|
||||
}
|
||||
|
||||
QString formatDiveWaterType(const dive *d)
|
||||
{
|
||||
return get_water_type_string(get_dive_salinity(d));
|
||||
}
|
||||
|
||||
// Qt's metatype system insists on generating a default constructed object, even if that makes no sense.
|
||||
DiveObjectHelper::DiveObjectHelper()
|
||||
{
|
||||
|
@ -286,7 +299,9 @@ DiveObjectHelper::DiveObjectHelper(const struct dive *d) :
|
|||
getCylinder(formatGetCylinder(d)),
|
||||
startPressure(getStartPressure(d)),
|
||||
endPressure(getEndPressure(d)),
|
||||
firstGas(getFirstGas(d))
|
||||
firstGas(getFirstGas(d)),
|
||||
salinity(formatDiveSalinity(d)),
|
||||
waterType(formatDiveWaterType(d))
|
||||
{
|
||||
#if defined(DEBUG_DOH)
|
||||
void *array[4];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue