summaryrefslogtreecommitdiffstats
path: root/qt-ui/models.cpp
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2013-05-01 14:49:17 -0700
committerGravatar Dirk Hohndel <dirk@hohndel.org>2013-05-01 14:49:17 -0700
commit482bea84c2f218f515b3b16556197379623a8028 (patch)
treee8192233b60bacf2f53cab913b451417d613aa35 /qt-ui/models.cpp
parent04e59a0e1cdb32c5091fc4bc0d692f00821ab849 (diff)
downloadsubsurface-482bea84c2f218f515b3b16556197379623a8028.tar.gz
Don't add cylinders and weightsystems past the MAX
We actually should disable the 'Add' button, I guess. 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 6756002e2..f1bb8d137 100644
--- a/qt-ui/models.cpp
+++ b/qt-ui/models.cpp
@@ -98,6 +98,7 @@ void CylindersModel::add(cylinder_t* cyl)
{
if (usedRows[current_dive] >= MAX_CYLINDERS) {
free(cyl);
+ return;
}
int row = usedRows[current_dive];
@@ -203,6 +204,7 @@ void WeightModel::add(weightsystem_t* weight)
{
if (usedRows[current_dive] >= MAX_WEIGHTSYSTEMS) {
free(weight);
+ return;
}
int row = usedRows[current_dive];