planner: get rid of global displayed_dive variable

Allocate the dive in the planner. This is all a bit convoluted
and needs more cleanup.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
Berthold Stoeger 2022-11-05 20:27:49 +01:00 committed by bstoeger
parent b5682369f8
commit 4c02d1c279
9 changed files with 251 additions and 233 deletions

View file

@ -18,9 +18,9 @@ Qt::ItemFlags GasSelectionModel::flags(const QModelIndex&) const
return Qt::ItemIsEnabled | Qt::ItemIsSelectable;
}
void GasSelectionModel::repopulate()
void GasSelectionModel::repopulate(const dive *d)
{
setStringList(get_dive_gas_list(&displayed_dive));
setStringList(get_dive_gas_list(d));
}
QVariant GasSelectionModel::data(const QModelIndex &index, int role) const