diff options
author | Berthold Stoeger <bstoeger@mail.tuwien.ac.at> | 2020-02-03 18:59:12 +0100 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2020-02-11 20:37:09 -0800 |
commit | 1336ea755b7ad2ef18cb869ca6219a1a6e237ff9 (patch) | |
tree | b5ecb061f62d98bcae4c7180c6ee777a2e604726 /qt-models/diveplannermodel.cpp | |
parent | 190a2a876e3fe3148c6cfce87ac630f251833066 (diff) | |
download | subsurface-1336ea755b7ad2ef18cb869ca6219a1a6e237ff9.tar.gz |
Planner: don't filter cylinders
In the planner we used to filter out "unused" cylinders as in the
equipment tab. It is unclear whether that makes sense or can even
easily be reproduced, since such cylinders have to come from an
imported dive.
To be on the save side, let's not do this. Replace the
CylindersFilteredModel introduced recently by a plain
CylindersModel.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'qt-models/diveplannermodel.cpp')
-rw-r--r-- | qt-models/diveplannermodel.cpp | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/qt-models/diveplannermodel.cpp b/qt-models/diveplannermodel.cpp index cf7dd0361..26d78bcb6 100644 --- a/qt-models/diveplannermodel.cpp +++ b/qt-models/diveplannermodel.cpp @@ -21,7 +21,7 @@ #define UNIT_FACTOR ((prefs.units.length == units::METERS) ? 1000.0 / 60.0 : feet_to_mm(1.0) / 60.0) -CylindersModelFiltered *DivePlannerPointsModel::cylindersModel() +CylindersModel *DivePlannerPointsModel::cylindersModel() { return &cylinders; } @@ -42,7 +42,7 @@ void DivePlannerPointsModel::removeSelectedPoints(const QVector<int> &rows) divepoints.remove(v2[i]); } endRemoveRows(); - cylinders.model()->updateTrashIcon(); + cylinders.updateTrashIcon(); } void DivePlannerPointsModel::createSimpleDive() @@ -320,7 +320,7 @@ bool DivePlannerPointsModel::setData(const QModelIndex &index, const QVariant &v if (value.toInt() >= 0) { p.depth = units_to_depth(value.toInt()); if (updateMaxDepth()) - cylinders.model()->updateBestMixes(); + cylinders.updateBestMixes(); } break; case RUNTIME: @@ -346,8 +346,8 @@ bool DivePlannerPointsModel::setData(const QModelIndex &index, const QVariant &v p.cylinderid = value.toInt(); /* Did we change the start (dp 0) cylinder to another cylinderid than 0? */ if (value.toInt() != 0 && index.row() == 0) - cylinders.model()->moveAtFirst(value.toInt()); - cylinders.model()->updateTrashIcon(); + cylinders.moveAtFirst(value.toInt()); + cylinders.updateTrashIcon(); break; case DIVEMODE: if (value.toInt() < FREEDIVE) { @@ -802,9 +802,9 @@ void DivePlannerPointsModel::editStop(int row, divedatapoint newData) divepoints[row] = newData; std::sort(divepoints.begin(), divepoints.end(), divePointsLessThan); if (updateMaxDepth()) - cylinders.model()->updateBestMixes(); + cylinders.updateBestMixes(); if (divepoints[0].cylinderid != old_first_cylid) - cylinders.model()->moveAtFirst(divepoints[0].cylinderid); + cylinders.moveAtFirst(divepoints[0].cylinderid); emitDataChanged(); } @@ -853,9 +853,9 @@ void DivePlannerPointsModel::remove(const QModelIndex &index) divepoints.remove(index.row()); } endRemoveRows(); - cylinders.model()->updateTrashIcon(); + cylinders.updateTrashIcon(); if (divepoints[0].cylinderid != old_first_cylid) - cylinders.model()->moveAtFirst(divepoints[0].cylinderid); + cylinders.moveAtFirst(divepoints[0].cylinderid); } struct diveplan &DivePlannerPointsModel::getDiveplan() |