summaryrefslogtreecommitdiffstats
path: root/qt-models/cylindermodel.cpp
diff options
context:
space:
mode:
authorGravatar Robert C. Helling <helling@atdotde.de>2017-12-01 12:49:38 +0100
committerGravatar Dirk Hohndel <dirk@hohndel.org>2017-12-01 15:47:51 -0800
commit4d605ce51fcb4bbadf83471568d9f315844f904b (patch)
treec229a24d96a44c8083a5e475f7701ae71fc9d8a4 /qt-models/cylindermodel.cpp
parente06b5072305324d26613760b213888919a92bbf7 (diff)
downloadsubsurface-4d605ce51fcb4bbadf83471568d9f315844f904b.tar.gz
Prevent redundant replanning
Planning dives is heavy on CPU, so better be sure we only do it when needed. In particular, when moving around dive points, we only want a new plan once per move and not three times (triggered at various points in the chain of events). This should significantly improve planner snappiness. Signed-off-by: Robert C. Helling <helling@atdotde.de>
Diffstat (limited to 'qt-models/cylindermodel.cpp')
-rw-r--r--qt-models/cylindermodel.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/qt-models/cylindermodel.cpp b/qt-models/cylindermodel.cpp
index 3979b13b6..9f34007c7 100644
--- a/qt-models/cylindermodel.cpp
+++ b/qt-models/cylindermodel.cpp
@@ -648,6 +648,7 @@ bool CylindersModel::updateBestMixes()
}
/* This slot is called when the bottom pO2 and END preferences are updated, we want to
* emit dataChanged so MOD and MND are refreshed, even if the gas mix hasn't been changed */
- emit dataChanged(createIndex(0, 0), createIndex(MAX_CYLINDERS - 1, COLUMNS - 1));
+ if (gasUpdated)
+ emit dataChanged(createIndex(0, 0), createIndex(MAX_CYLINDERS - 1, COLUMNS - 1));
return gasUpdated;
}