mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
planner: remove dc_number access from models
Instead of accessing the global dc_number from the DivePlannerPointsModel and the CylinderModel, pass them in the respective initialization functions. The dc_number global might not make sense on mobile. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
parent
d057af43b4
commit
832398180c
7 changed files with 20 additions and 14 deletions
|
@ -571,7 +571,7 @@ void PlannerWidgets::replanDive()
|
|||
return;
|
||||
copy_dive(current_dive, &displayed_dive); // Planning works on a copy of the dive (for now).
|
||||
DivePlannerPointsModel::instance()->setPlanMode(DivePlannerPointsModel::PLAN);
|
||||
DivePlannerPointsModel::instance()->loadFromDive(&displayed_dive);
|
||||
DivePlannerPointsModel::instance()->loadFromDive(&displayed_dive, dc_number);
|
||||
|
||||
plannerWidget.setReplanButton(true);
|
||||
plannerWidget.setupStartTime(timestampToDateTime(displayed_dive.when));
|
||||
|
@ -580,7 +580,7 @@ void PlannerWidgets::replanDive()
|
|||
if (displayed_dive.salinity)
|
||||
plannerWidget.setSalinity(displayed_dive.salinity);
|
||||
reset_cylinders(&displayed_dive, true);
|
||||
DivePlannerPointsModel::instance()->cylindersModel()->updateDive(&displayed_dive);
|
||||
DivePlannerPointsModel::instance()->cylindersModel()->updateDive(&displayed_dive, dc_number);
|
||||
}
|
||||
|
||||
void PlannerWidgets::printDecoPlan()
|
||||
|
|
|
@ -226,7 +226,7 @@ void ProfileWidget::divesChanged(const QVector<dive *> &dives, DiveField field)
|
|||
if (editedDive) {
|
||||
copy_dive(current_dive, editedDive.get());
|
||||
// TODO: Holy moly that function sends too many signals. Fix it!
|
||||
DivePlannerPointsModel::instance()->loadFromDive(editedDive.get());
|
||||
DivePlannerPointsModel::instance()->loadFromDive(editedDive.get(), editedDc);
|
||||
}
|
||||
|
||||
plotCurrentDive();
|
||||
|
@ -258,7 +258,7 @@ void ProfileWidget::editDive()
|
|||
copy_dive(current_dive, editedDive.get()); // Work on a copy of the dive
|
||||
originalDive = current_dive;
|
||||
DivePlannerPointsModel::instance()->setPlanMode(DivePlannerPointsModel::ADD);
|
||||
DivePlannerPointsModel::instance()->loadFromDive(editedDive.get());
|
||||
DivePlannerPointsModel::instance()->loadFromDive(editedDive.get(), editedDc);
|
||||
view->setEditState(editedDive.get(), editedDc);
|
||||
}
|
||||
|
||||
|
|
|
@ -139,7 +139,7 @@ void TabDiveEquipment::toggleTriggeredColumn()
|
|||
|
||||
void TabDiveEquipment::updateData()
|
||||
{
|
||||
cylindersModel->updateDive(current_dive);
|
||||
cylindersModel->updateDive(current_dive, dc_number);
|
||||
weightModel->updateDive(current_dive);
|
||||
|
||||
if (current_dive && current_dive->suit)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue