summaryrefslogtreecommitdiffstats
path: root/qt-ui/models.cpp
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2013-05-22 10:02:28 -0700
committerGravatar Dirk Hohndel <dirk@hohndel.org>2013-05-22 10:12:15 -0700
commit56c58bdd24451352e1f2a538c145f865b2546ac2 (patch)
treed34ad1da063dc337161d3e4d988ae5016fbdfc30 /qt-ui/models.cpp
parentd6bee060afaaf54b731c1e27b130089ebb5a9e40 (diff)
downloadsubsurface-56c58bdd24451352e1f2a538c145f865b2546ac2.tar.gz
Actually remove cylinders and weightsystems from the data structures
The UI had only stubbed this code out. This adds the implementation of the helpers and calls them. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui/models.cpp')
-rw-r--r--qt-ui/models.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/qt-ui/models.cpp b/qt-ui/models.cpp
index 360058dfd..ee1ae78ac 100644
--- a/qt-ui/models.cpp
+++ b/qt-ui/models.cpp
@@ -6,6 +6,7 @@
*/
#include "models.h"
#include "../helpers.h"
+#include "../dive.h"
#include <QCoreApplication>
#include <QDebug>
#include <QColor>
@@ -226,7 +227,9 @@ void CylindersModel::remove(const QModelIndex& index)
return;
}
beginRemoveRows(QModelIndex(), index.row(), index.row()); // yah, know, ugly.
- // Remove code should be here.
+ rows--;
+ remove_cylinder(current, index.row());
+ mark_divelist_changed(TRUE);
endRemoveRows();
}
@@ -236,7 +239,9 @@ void WeightModel::remove(const QModelIndex& index)
return;
}
beginRemoveRows(QModelIndex(), index.row(), index.row()); // yah, know, ugly.
- // Remove code should be here.
+ rows--;
+ remove_weightsystem(current, index.row());
+ mark_divelist_changed(TRUE);
endRemoveRows();
}