mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
planner: C++-ify a bit more
Use constructor and member functions. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
parent
74c8bd34a0
commit
0745c50e58
4 changed files with 79 additions and 82 deletions
|
@ -881,13 +881,7 @@ int DivePlannerPointsModel::addStop(int milimeters, int seconds, int cylinderid_
|
|||
|
||||
// add the new stop
|
||||
beginInsertRows(QModelIndex(), row, row);
|
||||
divedatapoint point;
|
||||
point.depth.mm = milimeters;
|
||||
point.time = seconds;
|
||||
point.cylinderid = cylinderid;
|
||||
point.setpoint = ccpoint;
|
||||
point.minimum_gas.mbar = 0;
|
||||
point.entered = entered;
|
||||
divedatapoint point(seconds, milimeters, cylinderid, ccpoint, entered);
|
||||
point.divemode = divemode;
|
||||
divepoints.insert(divepoints.begin() + row, point);
|
||||
endInsertRows();
|
||||
|
@ -1121,7 +1115,7 @@ void DivePlannerPointsModel::updateDiveProfile()
|
|||
if (!d)
|
||||
return;
|
||||
createTemporaryPlan();
|
||||
if (diveplan_empty(diveplan))
|
||||
if (diveplan.is_empty())
|
||||
return;
|
||||
|
||||
deco_state_cache cache;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue