diff options
author | Dirk Hohndel <dirk@hohndel.org> | 2013-11-13 21:56:51 +0900 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2013-11-13 21:56:51 +0900 |
commit | 1a3ea5636a7671e18c9f220e3ba181ef62740df8 (patch) | |
tree | 2fbc0e085228d3f9863efe49d1c785dfacdb7f79 /qt-ui | |
parent | d7fb6853a30d430d73df9d1b076ea194ddeacac2 (diff) | |
download | subsurface-1a3ea5636a7671e18c9f220e3ba181ef62740df8.tar.gz |
Don't change gas used in segments if there is still a cylinder with that gas
Otherwise adding a second cylinder (to the default one cylinder of air)
and subsequently changing the gas of that cylinder will illogically change
the gas used in all the segments.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui')
-rw-r--r-- | qt-ui/diveplanner.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/qt-ui/diveplanner.cpp b/qt-ui/diveplanner.cpp index 65a358489..6bc67ada0 100644 --- a/qt-ui/diveplanner.cpp +++ b/qt-ui/diveplanner.cpp @@ -1303,6 +1303,11 @@ void DivePlannerPointsModel::tanksUpdated() // either nothing relevant changed, or exactly ONE gasmix changed for (int i = 0; i < gases.length(); i++) { if (gases.at(i) != oldGases.at(i)) { + if (oldGases.count(oldGases.at(i)) > 1) { + // we had this gas more than once, so don't + // change segments that used this gas as it still exists + break; + } for (int j = 0; j < rowCount(); j++) { divedatapoint& p = divepoints[j]; int o2 = oldGases.at(i).first; |