diff options
Diffstat (limited to 'qt-models/divecomputermodel.cpp')
-rw-r--r-- | qt-models/divecomputermodel.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/qt-models/divecomputermodel.cpp b/qt-models/divecomputermodel.cpp index 51b1a767b..58641ff77 100644 --- a/qt-models/divecomputermodel.cpp +++ b/qt-models/divecomputermodel.cpp @@ -2,7 +2,7 @@ #include "dive.h" #include "divelist.h" -DiveComputerModel::DiveComputerModel(QMultiMap<QString, DiveComputerNode> &dcMap, QObject *parent) : CleanerTableModel() +DiveComputerModel::DiveComputerModel(QMultiMap<QString, DiveComputerNode> &dcMap, QObject *parent) : CleanerTableModel(parent) { setHeaderDataStrings(QStringList() << "" << tr("Model") << tr("Device ID") << tr("Nickname")); dcWorkingMap = dcMap; @@ -47,6 +47,7 @@ QVariant DiveComputerModel::data(const QModelIndex &index, int role) const int DiveComputerModel::rowCount(const QModelIndex &parent) const { + Q_UNUSED(parent); return numRows; } @@ -78,6 +79,10 @@ Qt::ItemFlags DiveComputerModel::flags(const QModelIndex &index) const bool DiveComputerModel::setData(const QModelIndex &index, const QVariant &value, int role) { + // We should test if the role == Qt::EditRole + Q_UNUSED(role); + + // WARN: This seems wrong - The values don't are ordered - we need a map from the Key to Index, or something. QList<DiveComputerNode> values = dcWorkingMap.values(); DiveComputerNode node = values.at(index.row()); dcWorkingMap.remove(node.model, node); |