summaryrefslogtreecommitdiffstats
path: root/qt-ui/diveplanner.cpp
diff options
context:
space:
mode:
authorGravatar Anton Lundin <glance@acc.umu.se>2014-07-09 23:37:30 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2014-07-09 14:40:36 -0700
commit2ff2daebd70907dcd6323371d5842d2bd064d28e (patch)
tree157d91a70661913bfc16b4842286bb4730ebd7e0 /qt-ui/diveplanner.cpp
parentf940ebcf74a7a398fb991796c56b831fa39959d1 (diff)
downloadsubsurface-2ff2daebd70907dcd6323371d5842d2bd064d28e.tar.gz
Move drop_stone_mode setting to prefs
There is no reason to treat drop_stone_mode different from the rest of the planner settings, so move it to our prefs structure. Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui/diveplanner.cpp')
-rw-r--r--qt-ui/diveplanner.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/qt-ui/diveplanner.cpp b/qt-ui/diveplanner.cpp
index 4abddd8e2..dded7cb44 100644
--- a/qt-ui/diveplanner.cpp
+++ b/qt-ui/diveplanner.cpp
@@ -76,7 +76,7 @@ void DivePlannerPointsModel::createSimpleDive()
// If we're in drop_stone_mode, don't add a first point.
// It will be added implicit.
- if (!drop_stone_mode)
+ if (!prefs.drop_stone_mode)
plannerModel->addStop(M_OR_FT(15, 45), 1 * 60, &gas, 0, true);
plannerModel->addStop(M_OR_FT(15, 45), 40 * 60, &gas, 0, true);
@@ -612,7 +612,7 @@ int DivePlannerPointsModel::rowCount(const QModelIndex &parent) const
return divepoints.count();
}
-DivePlannerPointsModel::DivePlannerPointsModel(QObject *parent) : QAbstractTableModel(parent), mode(NOTHING), drop_stone_mode(false)
+DivePlannerPointsModel::DivePlannerPointsModel(QObject *parent) : QAbstractTableModel(parent), mode(NOTHING)
{
memset(&diveplan, 0, sizeof(diveplan));
startTime = QDateTime::currentDateTimeUtc();
@@ -691,8 +691,8 @@ void DivePlannerPointsModel::setDisplayTransitions(bool value)
void DivePlannerPointsModel::setDropStoneMode(bool value)
{
- drop_stone_mode = value;
- if (drop_stone_mode) {
+ prefs.drop_stone_mode = value;
+ if (prefs.drop_stone_mode) {
/* Remove the first entry if we enable drop_stone_mode */
if (rowCount() >= 2) {
beginRemoveRows(QModelIndex(), 0, 0);
@@ -986,7 +986,7 @@ void DivePlannerPointsModel::createTemporaryPlan()
divedatapoint p = at(i);
int deltaT = lastIndex != -1 ? p.time - at(lastIndex).time : p.time;
lastIndex = i;
- if (i == 0 && drop_stone_mode) {
+ if (i == 0 && prefs.drop_stone_mode) {
/* Okay, we add a fist segment where we go down to depth */
plan_add_segment(&diveplan, p.depth / prefs.descrate, p.depth, p.gasmix, p.po2, false);
deltaT -= p.depth / prefs.descrate;