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>
This commit is contained in:
Dirk Hohndel 2013-05-22 10:02:28 -07:00
parent d6bee060af
commit 56c58bdd24
3 changed files with 34 additions and 8 deletions

View file

@ -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();
}