summaryrefslogtreecommitdiffstats
path: root/qt-ui/models.cpp
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2014-01-15 16:40:40 +0700
committerGravatar Dirk Hohndel <dirk@hohndel.org>2014-01-15 16:40:40 +0700
commit630eece8b23daa0668c649efadf45b420c948e70 (patch)
tree40d1bcc1e82d51ee124b827e97dcc7a2c7929d97 /qt-ui/models.cpp
parent781b99170ce407bf64fe97c2c2e96149b774880a (diff)
downloadsubsurface-630eece8b23daa0668c649efadf45b420c948e70.tar.gz
Fix "hide unused cylinder" behavior
There are at least two scenarios where our old code was flat out wrong. If you manually add a cylinder (because you may want to switch to it in the profile), then at least until the next time you restart Subsurface this cylinder should be shown. Also, when you switch to a cylinder by adding a gas switch event on the profile, that change should then make that cylinder visible. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui/models.cpp')
-rw-r--r--qt-ui/models.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/qt-ui/models.cpp b/qt-ui/models.cpp
index 63b97ad19..80f4073f7 100644
--- a/qt-ui/models.cpp
+++ b/qt-ui/models.cpp
@@ -274,6 +274,8 @@ void CylindersModel::add()
int row = rows;
fill_default_cylinder(&current->cylinder[row]);
+ // mark the cylinder as 'used' since it was manually added
+ current->cylinder[row].used = true;
beginInsertRows(QModelIndex(), row, row);
rows++;
changed = true;