summaryrefslogtreecommitdiffstats
path: root/profile-widget
diff options
context:
space:
mode:
Diffstat (limited to 'profile-widget')
-rw-r--r--profile-widget/diveeventitem.cpp18
-rw-r--r--profile-widget/diveprofileitem.cpp6
-rw-r--r--profile-widget/profilewidget2.cpp2
-rw-r--r--profile-widget/tankitem.cpp6
4 files changed, 16 insertions, 16 deletions
diff --git a/profile-widget/diveeventitem.cpp b/profile-widget/diveeventitem.cpp
index 13ab3770b..875954b37 100644
--- a/profile-widget/diveeventitem.cpp
+++ b/profile-widget/diveeventitem.cpp
@@ -92,20 +92,20 @@ void DiveEventItem::setupPixmap(struct gasmix *lastgasmix)
} else if (internalEvent->type == SAMPLE_EVENT_BOOKMARK) {
setPixmap(EVENT_PIXMAP(":dive-bookmark-icon"));
} else if (event_is_gaschange(internalEvent)) {
- struct gasmix *mix = get_gasmix_from_event(&displayed_dive, internalEvent);
+ struct gasmix mix = get_gasmix_from_event(&displayed_dive, internalEvent);
struct icd_data icd_data;
- bool icd = isobaric_counterdiffusion(lastgasmix, mix, &icd_data);
- if (mix->he.permille) {
+ bool icd = isobaric_counterdiffusion(lastgasmix, &mix, &icd_data);
+ if (mix.he.permille) {
if (icd)
setPixmap(EVENT_PIXMAP_BIGGER(":gaschange-trimix-ICD-icon"));
else
setPixmap(EVENT_PIXMAP_BIGGER(":gaschange-trimix-icon"));
- } else if (gasmix_is_air(mix)) {
+ } else if (gasmix_is_air(&mix)) {
if (icd)
setPixmap(EVENT_PIXMAP_BIGGER(":gaschange-air-ICD-icon"));
else
setPixmap(EVENT_PIXMAP_BIGGER(":gaschange-air-icon"));
- } else if (mix->o2.permille == 1000) {
+ } else if (mix.o2.permille == 1000) {
if (icd)
setPixmap(EVENT_PIXMAP_BIGGER(":gaschange-oxygen-ICD-icon"));
else
@@ -174,15 +174,15 @@ void DiveEventItem::setupToolTipString(struct gasmix *lastgasmix)
if (event_is_gaschange(internalEvent)) {
struct icd_data icd_data;
- struct gasmix *mix = get_gasmix_from_event(&displayed_dive, internalEvent);
+ struct gasmix mix = get_gasmix_from_event(&displayed_dive, internalEvent);
struct membuffer mb = {};
name += ": ";
- name += gasname(mix);
+ name += gasname(&mix);
/* Do we have an explicit cylinder index? Show it. */
if (internalEvent->gas.index >= 0)
name += tr(" (cyl. %1)").arg(internalEvent->gas.index + 1);
- bool icd = isobaric_counterdiffusion(lastgasmix, mix, &icd_data);
+ bool icd = isobaric_counterdiffusion(lastgasmix, &mix, &icd_data);
if (icd_data.dHe < 0) {
put_format(&mb, "\n%s %s:%+.3g%% %s:%+.3g%%%s%+.3g%%",
qPrintable(tr("ICD")),
@@ -192,7 +192,7 @@ void DiveEventItem::setupToolTipString(struct gasmix *lastgasmix)
name += QString::fromUtf8(mb.buffer, mb.len);
free_buffer(&mb);
}
- *lastgasmix = *mix;
+ *lastgasmix = mix;
} else if (same_string(internalEvent->name, "modechange")) {
name += QString(": %1").arg(gettextFromC::tr(divemode_text_ui[internalEvent->value]));
} else if (value) {
diff --git a/profile-widget/diveprofileitem.cpp b/profile-widget/diveprofileitem.cpp
index bedefb97e..94fb787b1 100644
--- a/profile-widget/diveprofileitem.cpp
+++ b/profile-widget/diveprofileitem.cpp
@@ -410,11 +410,11 @@ void DivePercentageItem::paint(QPainter *painter, const QStyleOptionGraphicsItem
for (int i = 1, modelDataCount = dataModel->rowCount(); i < modelDataCount; i++) {
if (i < poly.count()) {
double value = dataModel->index(i, vDataColumn).data().toDouble();
- struct gasmix *gasmix = NULL;
+ struct gasmix gasmix = { 0 };
struct event *ev = NULL;
int sec = dataModel->index(i, DivePlotDataModel::TIME).data().toInt();
- gasmix = get_gasmix(&displayed_dive, displayed_dc, sec, &ev, gasmix);
- int inert = 1000 - get_o2(gasmix);
+ gasmix = get_gasmix(&displayed_dive, displayed_dc, sec, &ev, &gasmix);
+ int inert = 1000 - get_o2(&gasmix);
mypen.setBrush(QBrush(ColorScale(value, inert)));
painter->setPen(mypen);
painter->drawLine(poly[i - 1], poly[i]);
diff --git a/profile-widget/profilewidget2.cpp b/profile-widget/profilewidget2.cpp
index cbd63cf40..d9875681a 100644
--- a/profile-widget/profilewidget2.cpp
+++ b/profile-widget/profilewidget2.cpp
@@ -759,7 +759,7 @@ void ProfileWidget2::plotDive(struct dive *d, bool force, bool doClearPictures)
eventItems.clear();
struct event *event = currentdc->events;
struct event *ev;
- struct gasmix lastgasmix = *get_gasmix(&displayed_dive, current_dc, 1, &ev, NULL);
+ struct gasmix lastgasmix = get_gasmix(&displayed_dive, current_dc, 1, &ev, NULL);
while (event) {
#ifndef SUBSURFACE_MOBILE
diff --git a/profile-widget/tankitem.cpp b/profile-widget/tankitem.cpp
index 22e5d3d21..d1adae41c 100644
--- a/profile-widget/tankitem.cpp
+++ b/profile-widget/tankitem.cpp
@@ -104,7 +104,7 @@ 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
@@ -112,14 +112,14 @@ void TankItem::modelDataChanged(const QModelIndex&, const QModelIndex&)
while (ev && (int)ev->time.seconds < last_entry->sec) {
width = hAxis->posAtValue(ev->time.seconds) - hAxis->posAtValue(startTime);
left = hAxis->posAtValue(startTime);
- createBar(left, width, gasmix);
+ createBar(left, width, &gasmix);
startTime = ev->time.seconds;
gasmix = get_gasmix_from_event(&displayed_dive, ev);
ev = get_next_event(ev->next, "gaschange");
}
width = hAxis->posAtValue(last_entry->sec) - hAxis->posAtValue(startTime);
left = hAxis->posAtValue(startTime);
- createBar(left, width, gasmix);
+ createBar(left, width, &gasmix);
}
void TankItem::setHorizontalAxis(DiveCartesianAxis *horizontal)