core: move gasname() to struct gasmix

Also, turn it to use std::string instead of writing into a
global(!) buffer. This was not reentrant.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
Berthold Stoeger 2024-07-02 12:38:36 +02:00 committed by bstoeger
parent 9c726d8d6f
commit 22a1120b30
14 changed files with 46 additions and 52 deletions

View file

@ -351,7 +351,7 @@ QVector<QPair<QString, int>> selectedDivesGasUsed()
std::vector<volume_t> diveGases = get_gas_used(d);
for (size_t j = 0; j < d->cylinders.size(); j++) {
if (diveGases[j].mliter) {
QString gasName = gasname(d->get_cylinder(j)->gasmix);
QString gasName = QString::fromStdString(d->get_cylinder(j)->gasmix.name());
gasUsed[gasName] += diveGases[j].mliter;
}
}