mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
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:
parent
9c726d8d6f
commit
22a1120b30
14 changed files with 46 additions and 52 deletions
|
@ -125,7 +125,7 @@ void DiveEventItem::setupToolTipString(struct gasmix lastgasmix)
|
|||
struct icd_data icd_data;
|
||||
struct gasmix mix = dive->get_gasmix_from_event(ev);
|
||||
name += ": ";
|
||||
name += gasname(mix);
|
||||
name += QString::fromStdString(mix.name());
|
||||
|
||||
/* Do we have an explicit cylinder index? Show it. */
|
||||
if (ev.gas.index >= 0)
|
||||
|
|
|
@ -57,7 +57,7 @@ void TankItem::createBar(int startTime, int stopTime, struct gasmix gas)
|
|||
rect->setPen(QPen(QBrush(), 0.0)); // get rid of the thick line around the rectangle
|
||||
rects.push_back(rect);
|
||||
DiveTextItem *label = new DiveTextItem(dpr, 1.0, Qt::AlignVCenter | Qt::AlignRight, rect);
|
||||
label->set(gasname(gas), Qt::black);
|
||||
label->set(QString::fromStdString(gas.name()), Qt::black);
|
||||
label->setPos(x + 2.0 * dpr, height() / 2.0);
|
||||
label->setZValue(101);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue