summaryrefslogtreecommitdiffstats
path: root/qt-models/diveplannermodel.cpp
diff options
context:
space:
mode:
authorGravatar Rick Walsh <rickmwalsh@gmail.com>2015-07-04 22:14:10 +1000
committerGravatar Dirk Hohndel <dirk@hohndel.org>2015-07-05 06:37:01 -0700
commit8c4e1e6bfadaaa90c3f084c606a4ddf0bd30a95b (patch)
tree05eec4f59be59042a73bf8d66905ab46aa069120 /qt-models/diveplannermodel.cpp
parent896b7a5e74b4dad8c726b9983f56776bf9995294 (diff)
downloadsubsurface-8c4e1e6bfadaaa90c3f084c606a4ddf0bd30a95b.tar.gz
Read planner preferences when we use them
Read and use the last_stop preference in the plan function. Read the plan notes preferences and set variables (plan_verbatim, plan_display_runtime, plan_display_duration, and plan_display_transitions) in the add_plan_to_notes function. Don't read the preferences and set variables otherwise. Both plan and add_plan_to_notes functions are called on data change. Previous behaviour was: - Set variables on declaration - Reset variables in plan function (even variables that only relate to planner notes output) - Changing a preference triggered set_xxx function which sets variable, then plan function, which sets variable again. Apart from being inefficient, the previous behaviour made it difficult to track down where and when variables were set. Signed-off-by: Rick Walsh <rickmwalsh@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-models/diveplannermodel.cpp')
-rw-r--r--qt-models/diveplannermodel.cpp5
1 files changed, 0 insertions, 5 deletions
diff --git a/qt-models/diveplannermodel.cpp b/qt-models/diveplannermodel.cpp
index e28b4d146..439e7a4de 100644
--- a/qt-models/diveplannermodel.cpp
+++ b/qt-models/diveplannermodel.cpp
@@ -416,35 +416,30 @@ int DivePlannerPointsModel::getSurfacePressure()
void DivePlannerPointsModel::setLastStop6m(bool value)
{
- set_last_stop(value);
prefs.last_stop = value;
emit dataChanged(createIndex(0, 0), createIndex(rowCount() - 1, COLUMNS - 1));
}
void DivePlannerPointsModel::setVerbatim(bool value)
{
- set_verbatim(value);
prefs.verbatim_plan = value;
emit dataChanged(createIndex(0, 0), createIndex(rowCount() - 1, COLUMNS - 1));
}
void DivePlannerPointsModel::setDisplayRuntime(bool value)
{
- set_display_runtime(value);
prefs.display_runtime = value;
emit dataChanged(createIndex(0, 0), createIndex(rowCount() - 1, COLUMNS - 1));
}
void DivePlannerPointsModel::setDisplayDuration(bool value)
{
- set_display_duration(value);
prefs.display_duration = value;
emit dataChanged(createIndex(0, 0), createIndex(rowCount() - 1, COLUMNS - 1));
}
void DivePlannerPointsModel::setDisplayTransitions(bool value)
{
- set_display_transitions(value);
prefs.display_transitions = value;
emit dataChanged(createIndex(0, 0), createIndex(rowCount() - 1, COLUMNS - 1));
}