diff options
author | Tomaz Canabrava <tomaz.canabrava@intel.com> | 2014-05-14 22:27:26 -0300 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2014-05-20 14:48:07 +0900 |
commit | 0b6cbe0f79d7707297211850963323eb77d21c20 (patch) | |
tree | b0e0633f39e7f9b52beb2debe6b38341cc713cfd /qt-ui/profile/diveprofileitem.cpp | |
parent | b34fb70d780d52d13bbfa69923864d68d3cdbb8a (diff) | |
download | subsurface-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.cpp | 12 |
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))); } |