Correctly edit air/water temp in dive struct

When changing the values of air/water temp after the first time and save,
it will be reset the intial value.
This is fixed by removing the "select_dc" (which makes the change to the
dive struct instead).

Fixes #457

Signed-off-by: Yousef Hamza <jo.adama.93@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Yosef Hamza 2014-04-08 12:30:05 +02:00 committed by Dirk Hohndel
parent 55d010bad8
commit 3027701a14

View file

@ -879,14 +879,14 @@ void MainTab::on_divemaster_textChanged()
void MainTab::on_airtemp_textChanged(const QString &text)
{
EDIT_SELECTED_DIVES(select_dc(mydive)->airtemp.mkelvin = parseTemperatureToMkelvin(text));
EDIT_SELECTED_DIVES(mydive->airtemp.mkelvin = parseTemperatureToMkelvin(text));
markChangedWidget(ui.airtemp);
validate_temp_field(ui.airtemp, text);
}
void MainTab::on_watertemp_textChanged(const QString &text)
{
EDIT_SELECTED_DIVES(select_dc(mydive)->watertemp.mkelvin = parseTemperatureToMkelvin(text));
EDIT_SELECTED_DIVES(mydive->watertemp.mkelvin = parseTemperatureToMkelvin(text));
markChangedWidget(ui.watertemp);
validate_temp_field(ui.watertemp, text);
}