mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
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>
This commit is contained in:
parent
8e8cd7a8d9
commit
1f654050fa
6 changed files with 63 additions and 103 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue