[Propose Patch] Fixing #457 Air temp and water temp not saved

Long Wu wulong at comp.nus.edu.sg
Thu Mar 20 11:30:08 PDT 2014


The following patch solved the problem described at #457 by removing
select_dc().

So here is the question, is select_dc means select dive computer? If so,
that means the temperatures are coming from external device, so these two
temperature fields should not allowed to modify.

If that is user input, then this patch should be correct, please help
verify this.:)


------------------------------------------------------------------------------------------------------------------

Subject: [PATCH 3/3] Fixed Air and Water Temp Not Saved

After remove select_dc() for 'mydive', the problem described at ticket #457
solved.

Because select_dc(mydive) will switch to different dive structure.

Signed-off-by: Hugle <wulong at comp.nus.edu.sg>
---
 qt-ui/maintab.cpp | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/qt-ui/maintab.cpp b/qt-ui/maintab.cpp
index 9828389..d9153cf 100644
--- a/qt-ui/maintab.cpp
+++ b/qt-ui/maintab.cpp
@@ -865,13 +865,13 @@ 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);
 }

 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);
 }

-- 
1.8.5.5
Best regards,

Hugle
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.hohndel.org/pipermail/subsurface/attachments/20140321/2d9a4efd/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0003-Fixed-Air-and-Water-Temp-Not-Saved.patch
Type: application/octet-stream
Size: 1250 bytes
Desc: not available
URL: <http://lists.hohndel.org/pipermail/subsurface/attachments/20140321/2d9a4efd/attachment-0001.obj>


More information about the subsurface mailing list