summaryrefslogtreecommitdiffstats
path: root/profile-widget/diveeventitem.cpp
diff options
context:
space:
mode:
authorGravatar Stefan Fuchs <sfuchs@gmx.de>2017-10-19 21:55:46 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2017-10-19 19:00:55 -0400
commitc3274b0b9ff9cb3827ac867b0aaec545ebaa29a8 (patch)
treebcad01140e8b6d6891970e5a4f6c3c305a98d57f /profile-widget/diveeventitem.cpp
parenta422957cd6525b9753cafacfafdf1f3eef66870d (diff)
downloadsubsurface-c3274b0b9ff9cb3827ac867b0aaec545ebaa29a8.tar.gz
When selecting icons for events don't misinterpret a gaschange
Don't misinterpret a gaschange as "useless internal of the dive computer" when it has a higher flag value. Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
Diffstat (limited to 'profile-widget/diveeventitem.cpp')
-rw-r--r--profile-widget/diveeventitem.cpp20
1 files changed, 10 insertions, 10 deletions
diff --git a/profile-widget/diveeventitem.cpp b/profile-widget/diveeventitem.cpp
index f81fa41fe..b939c4ff8 100644
--- a/profile-widget/diveeventitem.cpp
+++ b/profile-widget/diveeventitem.cpp
@@ -82,6 +82,16 @@ void DiveEventItem::setupPixmap()
setPixmap(EVENT_PIXMAP(":warning-icon"));
} else if (internalEvent->type == SAMPLE_EVENT_BOOKMARK) {
setPixmap(EVENT_PIXMAP(":flag"));
+ } else if (event_is_gaschange(internalEvent)) {
+ struct gasmix *mix = get_gasmix_from_event(&displayed_dive, internalEvent);
+ if (mix->he.permille)
+ setPixmap(EVENT_PIXMAP_BIGGER(":gaschangeTrimix"));
+ else if (gasmix_is_air(mix))
+ setPixmap(EVENT_PIXMAP_BIGGER(":gaschangeAir"));
+ else if (mix->o2.permille == 1000)
+ setPixmap(EVENT_PIXMAP_BIGGER(":gaschangeOxy"));
+ else
+ setPixmap(EVENT_PIXMAP_BIGGER(":gaschangeNitrox"));
#ifdef SAMPLE_FLAGS_SEVERITY_SHIFT
} else if ((((internalEvent->flags & SAMPLE_FLAGS_SEVERITY_MASK) >> SAMPLE_FLAGS_SEVERITY_SHIFT) == 1) ||
// those are useless internals of the dive computer
@@ -100,16 +110,6 @@ void DiveEventItem::setupPixmap()
QPixmap transparentPixmap(4, 20);
transparentPixmap.fill(QColor::fromRgbF(1.0, 1.0, 1.0, 0.01));
setPixmap(transparentPixmap);
- } else if (event_is_gaschange(internalEvent)) {
- struct gasmix *mix = get_gasmix_from_event(&displayed_dive, internalEvent);
- if (mix->he.permille)
- setPixmap(EVENT_PIXMAP_BIGGER(":gaschangeTrimix"));
- else if (gasmix_is_air(mix))
- setPixmap(EVENT_PIXMAP_BIGGER(":gaschangeAir"));
- else if (mix->o2.permille == 1000)
- setPixmap(EVENT_PIXMAP_BIGGER(":gaschangeOxy"));
- else
- setPixmap(EVENT_PIXMAP_BIGGER(":gaschangeNitrox"));
#ifdef SAMPLE_FLAGS_SEVERITY_SHIFT
} else if (((internalEvent->flags & SAMPLE_FLAGS_SEVERITY_MASK) >> SAMPLE_FLAGS_SEVERITY_SHIFT) == 2) {
setPixmap(EVENT_PIXMAP(":info-icon"));