diff options
Diffstat (limited to 'profile-widget/tankitem.cpp')
-rw-r--r-- | profile-widget/tankitem.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/profile-widget/tankitem.cpp b/profile-widget/tankitem.cpp index 22e5d3d21..2bbcdc1a7 100644 --- a/profile-widget/tankitem.cpp +++ b/profile-widget/tankitem.cpp @@ -57,15 +57,15 @@ void TankItem::setData(DivePlotDataModel *model, struct plot_info *plotInfo, str modelDataChanged(); } -void TankItem::createBar(qreal x, qreal w, struct gasmix *gas) +void TankItem::createBar(qreal x, qreal w, struct gasmix gas) { // pick the right gradient, size, position and text QGraphicsRectItem *rect = new QGraphicsRectItem(x, 0, w, height, this); if (gasmix_is_air(gas)) rect->setBrush(air); - else if (gas->he.permille) + else if (gas.he.permille) rect->setBrush(trimix); - else if (gas->o2.permille == 1000) + else if (gas.o2.permille == 1000) rect->setBrush(oxygen); else rect->setBrush(nitrox); @@ -104,11 +104,11 @@ void TankItem::modelDataChanged(const QModelIndex&, const QModelIndex&) // start with the first gasmix and at the start of the dive int cyl = explicit_first_cylinder(&displayed_dive, dc); - struct gasmix *gasmix = &displayed_dive.cylinder[cyl].gasmix; + struct gasmix gasmix = displayed_dive.cylinder[cyl].gasmix; int startTime = 0; // work through all the gas changes and add the rectangle for each gas while it was used - struct event *ev = get_next_event(dc->events, "gaschange"); + const struct event *ev = get_next_event(dc->events, "gaschange"); while (ev && (int)ev->time.seconds < last_entry->sec) { width = hAxis->posAtValue(ev->time.seconds) - hAxis->posAtValue(startTime); left = hAxis->posAtValue(startTime); |