summaryrefslogtreecommitdiffstats
path: root/qt-models/divecomputermodel.h
diff options
context:
space:
mode:
authorGravatar Berthold Stoeger <bstoeger@mail.tuwien.ac.at>2018-06-16 14:06:35 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2018-06-17 06:53:13 +0900
commit1f654050fa7e461166ee4d8b46d66b4ca91f31d4 (patch)
treef6158e8fc750ccd5de64b15a04a242f72ca3cd67 /qt-models/divecomputermodel.h
parent8e8cd7a8d9304b96cc80fbd2ea63e28d9f7595a3 (diff)
downloadsubsurface-1f654050fa7e461166ee4d8b46d66b4ca91f31d4.tar.gz
Dive computers: turn QMultiMap into sorted vector
The list of known dive computers was stored in a multi-map indexed by the device name. Turn this into a sorted QVector. Thus, no map-to-list conversion is needed in the device editing dialog, which distinctly simplifies the code. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'qt-models/divecomputermodel.h')
-rw-r--r--qt-models/divecomputermodel.h6
1 files changed, 2 insertions, 4 deletions
diff --git a/qt-models/divecomputermodel.h b/qt-models/divecomputermodel.h
index 62a20c96d..019bb8f62 100644
--- a/qt-models/divecomputermodel.h
+++ b/qt-models/divecomputermodel.h
@@ -14,14 +14,12 @@ public:
ID,
NICKNAME
};
- DiveComputerModel(QMultiMap<QString, DiveComputerNode> &dcMap, QObject *parent = 0);
+ DiveComputerModel(QObject *parent = 0);
virtual QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const;
virtual int rowCount(const QModelIndex &parent = QModelIndex()) const;
virtual Qt::ItemFlags flags(const QModelIndex &index) const;
virtual bool setData(const QModelIndex &index, const QVariant &value, int role = Qt::EditRole);
- void update();
void keepWorkingList();
- void dropWorkingList();
public
slots:
@@ -29,7 +27,7 @@ slots:
private:
int numRows;
- QMultiMap<QString, DiveComputerNode> dcWorkingMap;
+ QVector<DiveComputerNode> dcs;
};
#endif