mirror of
https://github.com/subsurface/subsurface.git
synced 2025-01-31 22:23:24 +00:00
Silence warnings in divecomputermodel
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
14ad5b0bd2
commit
302f3ac6ae
1 changed files with 5 additions and 1 deletions
|
@ -2,7 +2,7 @@
|
||||||
#include "dive.h"
|
#include "dive.h"
|
||||||
#include "divelist.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"));
|
setHeaderDataStrings(QStringList() << "" << tr("Model") << tr("Device ID") << tr("Nickname"));
|
||||||
dcWorkingMap = dcMap;
|
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)
|
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();
|
QList<DiveComputerNode> values = dcWorkingMap.values();
|
||||||
DiveComputerNode node = values.at(index.row());
|
DiveComputerNode node = values.at(index.row());
|
||||||
dcWorkingMap.remove(node.model, node);
|
dcWorkingMap.remove(node.model, node);
|
||||||
|
|
Loading…
Add table
Reference in a new issue