cleanup: move formatting of gas type to string-format.cpp

Since the only caller was C++ code, this can be done in
C++ code, which removes memory-management headaches.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
Berthold Stoeger 2023-03-17 08:21:47 +01:00 committed by Dirk Hohndel
parent 468c1d8d61
commit 264adacba1
5 changed files with 26 additions and 37 deletions

View file

@ -355,12 +355,7 @@ QVariant DiveTripModelBase::diveData(const struct dive *d, int column, int role)
case LOCATION:
return QString(get_dive_location(d));
case GAS:
{
char *gas_string = get_dive_gas_string(d);
QString ret(gas_string);
free(gas_string);
return ret;
}
return formatDiveGasString(d);
case NOTES:
return QString(d->notes);
}