summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--qt-models/divecomputermodel.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/qt-models/divecomputermodel.cpp b/qt-models/divecomputermodel.cpp
index 51b1a767b..7b87d872d 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;
@@ -78,6 +78,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);