Second model converted to be less boilerplated.

Second model converted to be less boilerplated,
there are right now 7 models that will need to
be ported. each model can remove around 30 to 40
LOC, so this is not such a bigger improvement,
but it's an 'keeping an eye on the future'.

Also fixed a bug where the returned value was dummy.

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
This commit is contained in:
Tomaz Canabrava 2013-10-11 11:04:27 -03:00
parent 26c87fafc2
commit a4efa8c444
2 changed files with 7 additions and 35 deletions

View file

@ -109,14 +109,12 @@ private:
/* Encapsulation of the Weight Model, that represents
* the current weights on a dive. */
class WeightModel : public QAbstractTableModel {
class WeightModel : public CleanerTableModel {
Q_OBJECT
public:
enum Column {REMOVE, TYPE, WEIGHT, COLUMNS};
enum Column {REMOVE, TYPE, WEIGHT};
explicit WeightModel(QObject *parent = 0);
/*reimp*/ QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const;
/*reimp*/ int columnCount(const QModelIndex& parent = QModelIndex()) const;
/*reimp*/ QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const;
/*reimp*/ int rowCount(const QModelIndex& parent = QModelIndex()) const;
/*reimp*/ Qt::ItemFlags flags(const QModelIndex& index) const;