mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
planner: move repopulation of models to planner
The gas and dive-type models were repopulated in the diveplanner model. The former are used in the planner. However, the latter is also used outside of the planner, when editing non-planned dives. Thus the former shouldn't be repopulated by the latter, but by the code that needs it. Side note: repopulating the dive-type model seems to make no sense whatsoever since the values never change, but let's keep it for now. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
parent
d51589b9a7
commit
3dd09b31e3
3 changed files with 5 additions and 5 deletions
|
|
@ -5,8 +5,8 @@
|
|||
#include "core/divelog.h"
|
||||
#include "core/subsurface-string.h"
|
||||
#include "qt-models/cylindermodel.h"
|
||||
#include "qt-models/models.h" // For defaultModelFont().
|
||||
#include "core/planner.h"
|
||||
#include "qt-models/models.h"
|
||||
#include "core/device.h"
|
||||
#include "core/qthelper.h"
|
||||
#include "core/range.h"
|
||||
|
|
@ -87,8 +87,6 @@ void DivePlannerPointsModel::createSimpleDive(struct dive *dIn)
|
|||
addStop(M_OR_FT(5, 15), 45 * 60, 0, cylinderid, true, UNDEF_COMP_TYPE);
|
||||
}
|
||||
updateDiveProfile();
|
||||
GasSelectionModel::instance()->repopulate();
|
||||
DiveTypeSelectionModel::instance()->repopulate();
|
||||
}
|
||||
|
||||
void DivePlannerPointsModel::setupStartTime()
|
||||
|
|
@ -179,7 +177,6 @@ void DivePlannerPointsModel::loadFromDive(dive *dIn, int dcNrIn)
|
|||
current_divemode = get_current_divemode(dc, d->dc.duration.seconds, &evd, ¤t_divemode);
|
||||
if (!hasMarkedSamples && !dc->last_manual_time.seconds)
|
||||
addStop(0, d->dc.duration.seconds,cylinderid, last_sp.mbar, true, current_divemode);
|
||||
DiveTypeSelectionModel::instance()->repopulate();
|
||||
preserved_until = d->duration;
|
||||
|
||||
updateDiveProfile();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue