mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
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>
This commit is contained in:
parent
b34fb70d78
commit
0b6cbe0f79
1 changed files with 3 additions and 9 deletions
|
@ -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)));
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue