summaryrefslogtreecommitdiffstats
path: root/qt-ui/profilegraphics.cpp
diff options
context:
space:
mode:
authorGravatar Anton Lundin <glance@acc.umu.se>2013-11-22 00:09:26 +0100
committerGravatar Dirk Hohndel <dirk@hohndel.org>2013-11-21 15:54:34 -0800
commit891892cde443a6e6fe53ec808c66fc3a698c68c7 (patch)
tree8fb23595f2b446e9ccf745d23134c69aa5e45fac /qt-ui/profilegraphics.cpp
parent26656310aba5f5de5c873603f8e74d56283d12a9 (diff)
downloadsubsurface-891892cde443a6e6fe53ec808c66fc3a698c68c7.tar.gz
Cleanup and bugfix gaschange event printing
When a gaschange to air happened, the code did name += name=+ tr("air") which probably was due to the block being just confusing with all the ?: Unrolls to proper if statements, and fixes the bug. Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui/profilegraphics.cpp')
-rw-r--r--qt-ui/profilegraphics.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/qt-ui/profilegraphics.cpp b/qt-ui/profilegraphics.cpp
index 834d7bdb1..f2d8e74df 100644
--- a/qt-ui/profilegraphics.cpp
+++ b/qt-ui/profilegraphics.cpp
@@ -954,9 +954,12 @@ void ProfileGraphicsView::plot_one_event(struct event *ev)
int o2 = get_o2(&dive->cylinder[entry->cylinderindex].gasmix);
name += ": ";
- name += (he) ? QString("%1/%2").arg((o2 + 5) / 10).arg((he + 5) / 10)
- : is_air(o2, he) ? name += tr("air")
- : QString(tr("EAN%1")).arg((o2 + 5) / 10);
+ if (he)
+ name += QString("%1/%2").arg((o2 + 5) / 10).arg((he + 5) / 10);
+ else if(is_air(o2, he))
+ name += tr("air");
+ else
+ name += QString(tr("EAN%1")).arg((o2 + 5) / 10);
} else if (ev->name && !strcmp(ev->name, "SP change")) {
name += QString(":%1").arg((double) ev->value / 1000);