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:
Berthold Stoeger 2018-06-16 14:06:35 +02:00 committed by Dirk Hohndel
parent 8e8cd7a8d9
commit 1f654050fa
6 changed files with 63 additions and 103 deletions

View file

@ -19,8 +19,7 @@ DiveComputerManagementDialog::DiveComputerManagementDialog(QWidget *parent, Qt::
void DiveComputerManagementDialog::init()
{
model.reset(new DiveComputerModel(dcList.dcMap));
model->update();
model.reset(new DiveComputerModel);
ui.tableView->setModel(model.data());
ui.tableView->resizeColumnsToContents();
ui.tableView->setColumnWidth(DiveComputerModel::REMOVE, 22);
@ -57,7 +56,6 @@ void DiveComputerManagementDialog::accept()
void DiveComputerManagementDialog::reject()
{
model->dropWorkingList();
hide();
close();
}