summaryrefslogtreecommitdiffstats
path: root/qt-ui/diveplanner.cpp
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2014-05-30 15:40:13 -0700
committerGravatar Dirk Hohndel <dirk@hohndel.org>2014-05-30 15:40:13 -0700
commit65f3135a92cb9bb33c9870105334ca458e1f151d (patch)
tree033889895ff6b40989e1070fdc59d5e9ec231aa5 /qt-ui/diveplanner.cpp
parentb791b41db98ddec7b25448092fa30f24224af8c5 (diff)
downloadsubsurface-65f3135a92cb9bb33c9870105334ca458e1f151d.tar.gz
Planner: don't do unnecessary work on empty dive plans
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui/diveplanner.cpp')
-rw-r--r--qt-ui/diveplanner.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/qt-ui/diveplanner.cpp b/qt-ui/diveplanner.cpp
index 2b1662f7d..0d5b79edd 100644
--- a/qt-ui/diveplanner.cpp
+++ b/qt-ui/diveplanner.cpp
@@ -777,6 +777,8 @@ void DivePlannerPointsModel::addDecoToModel()
{
struct divedatapoint *dp;
+ if (diveplan_empty(&diveplan))
+ return;
bool oldRecalc = plannerModel->setRecalc(false);
plannerModel->removeDeco();
@@ -832,7 +834,7 @@ void DivePlannerPointsModel::createTemporaryPlan()
#if DEBUG_PLAN
dump_plan(&diveplan);
#endif
- if (plannerModel->recalcQ()) {
+ if (plannerModel->recalcQ() && !diveplan_empty(&diveplan)) {
plan(&diveplan, &cache, &tempDive, stagingDive, isPlanner());
addDecoToModel();
if (mode == ADD || mode == PLAN) {