mirror of
https://github.com/subsurface/subsurface.git
synced 2024-11-30 22:20:21 +00:00
Undo: move temperature update from MainTab to EditWaterTemp
The code in maintab is not called anymore (unless cylinders or weightsystems are changed). Move the code to the command that edits water temperature. This should be audited as it is unclear weather this is necessary. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
parent
c4ad477d07
commit
91c33b475c
2 changed files with 4 additions and 11 deletions
|
@ -230,6 +230,9 @@ DiveField EditAirTemp::fieldId() const
|
||||||
void EditWaterTemp::set(struct dive *d, int value) const
|
void EditWaterTemp::set(struct dive *d, int value) const
|
||||||
{
|
{
|
||||||
d->watertemp.mkelvin = value > 0 ? (uint32_t)value : 0u;
|
d->watertemp.mkelvin = value > 0 ? (uint32_t)value : 0u;
|
||||||
|
|
||||||
|
// re-populate the temperatures - easiest way to do this is by calling fixup_dive
|
||||||
|
fixup_dive(d);
|
||||||
}
|
}
|
||||||
|
|
||||||
int EditWaterTemp::data(struct dive *d) const
|
int EditWaterTemp::data(struct dive *d) const
|
||||||
|
|
|
@ -735,8 +735,7 @@ static QVector<dive *> getSelectedDivesCurrentLast()
|
||||||
|
|
||||||
void MainTab::acceptChanges()
|
void MainTab::acceptChanges()
|
||||||
{
|
{
|
||||||
int i, addedId = -1;
|
int addedId = -1;
|
||||||
struct dive *d;
|
|
||||||
bool do_replot = false;
|
bool do_replot = false;
|
||||||
|
|
||||||
if (ui.location->hasFocus())
|
if (ui.location->hasFocus())
|
||||||
|
@ -849,15 +848,6 @@ void MainTab::acceptChanges()
|
||||||
cd->weightsystem[i].description = copy_string(displayed_dive.weightsystem[i].description);
|
cd->weightsystem[i].description = copy_string(displayed_dive.weightsystem[i].description);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// each dive that was selected might have had the temperatures in its active divecomputer changed
|
|
||||||
// so re-populate the temperatures - easiest way to do this is by calling fixup_dive
|
|
||||||
for_each_dive (i, d) {
|
|
||||||
if (d->selected) {
|
|
||||||
fixup_dive(d);
|
|
||||||
invalidate_dive_cache(d);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if (lastMode == MANUALLY_ADDED_DIVE) {
|
if (lastMode == MANUALLY_ADDED_DIVE) {
|
||||||
// we just added or edited the dive, let fixup_dive() make
|
// we just added or edited the dive, let fixup_dive() make
|
||||||
|
|
Loading…
Reference in a new issue