aboutsummaryrefslogtreecommitdiffstats
path: root/qt-ui/profile/diveprofileitem.cpp
diff options
context:
space:
mode:
authorGravatar Tomaz Canabrava <tomaz.canabrava@intel.com>2014-05-14 22:27:26 -0300
committerGravatar Dirk Hohndel <dirk@hohndel.org>2014-05-20 14:48:07 +0900
commit0b6cbe0f79d7707297211850963323eb77d21c20 (patch)
treeb0e0633f39e7f9b52beb2debe6b38341cc713cfd /qt-ui/profile/diveprofileitem.cpp
parentb34fb70d780d52d13bbfa69923864d68d3cdbb8a (diff)
downloadsubsurface-0b6cbe0f79d7707297211850963323eb77d21c20.tar.gz
Code Cleanup: use qMin instad of if( min ) setMin else setMax.
silly code cleanup. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui/profile/diveprofileitem.cpp')
-rw-r--r--qt-ui/profile/diveprofileitem.cpp12
1 files changed, 3 insertions, 9 deletions
diff --git a/qt-ui/profile/diveprofileitem.cpp b/qt-ui/profile/diveprofileitem.cpp
index 6f4c2a599..58c4a868b 100644
--- a/qt-ui/profile/diveprofileitem.cpp
+++ b/qt-ui/profile/diveprofileitem.cpp
@@ -156,10 +156,8 @@ void DiveProfileItem::modelDataChanged(const QModelIndex &topLeft, const QModelI
if (!entry->in_deco) {
/* not in deco implies this is a safety stop, no ceiling */
p.append(QPointF(hAxis->posAtValue(entry->sec), vAxis->posAtValue(0)));
- } else if (entry->stopdepth < entry->depth) {
- p.append(QPointF(hAxis->posAtValue(entry->sec), vAxis->posAtValue(entry->stopdepth)));
- } else {
- p.append(QPointF(hAxis->posAtValue(entry->sec), vAxis->posAtValue(entry->depth)));
+ } else{
+ p.append(QPointF(hAxis->posAtValue(entry->sec), vAxis->posAtValue(qMin(entry->stopdepth, entry->depth))));
}
}
setPolygon(p);
@@ -562,11 +560,7 @@ void DiveReportedCeiling::modelDataChanged(const QModelIndex &topLeft, const QMo
plot_data *entry = dataModel->data().entry;
for (int i = 0, count = dataModel->rowCount(); i < count; i++, entry++) {
if (entry->in_deco && entry->stopdepth) {
- if (entry->stopdepth < entry->depth) {
- p.append(QPointF(hAxis->posAtValue(entry->sec), vAxis->posAtValue(entry->stopdepth)));
- } else {
- p.append(QPointF(hAxis->posAtValue(entry->sec), vAxis->posAtValue(entry->depth)));
- }
+ p.append(QPointF(hAxis->posAtValue(entry->sec), vAxis->posAtValue(qMin(entry->stopdepth, entry->depth))));
} else {
p.append(QPointF(hAxis->posAtValue(entry->sec), vAxis->posAtValue(0)));
}