diff options
author | Dirk Hohndel <dirk@hohndel.org> | 2013-11-29 12:05:21 -0800 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2013-11-29 12:05:21 -0800 |
commit | ff5fa70a88d2ac0c424a1f1a994837ebe7e27d9d (patch) | |
tree | a226397bac03cb6928d761a96c23a32d11593dee /save-xml.c | |
parent | d936c55a015789f61f7e93426b11218ebb4312af (diff) | |
download | subsurface-ff5fa70a88d2ac0c424a1f1a994837ebe7e27d9d.tar.gz |
Editing air or water temperature should modify dive computer, not dive
The dive fields are summary fields, the actual data needs to be in the
divecomputer specific fields.
Fixes #307
Diffstat (limited to 'save-xml.c')
-rw-r--r-- | save-xml.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/save-xml.c b/save-xml.c index 0b83a0235..631abda9a 100644 --- a/save-xml.c +++ b/save-xml.c @@ -153,13 +153,16 @@ static void save_depths(FILE *f, struct divecomputer *dc) static void save_dive_temperature(FILE *f, struct dive *dive) { - if (!dive->airtemp.mkelvin) + if (!dive->airtemp.mkelvin && !dive->watertemp.mkelvin) return; - if (dive->airtemp.mkelvin == dc_airtemp(&dive->dc)) + if (dive->airtemp.mkelvin == dc_airtemp(&dive->dc) || dive->watertemp.mkelvin == dc_watertemp(&dive->dc)) return; fputs(" <divetemperature", f); - show_temperature(f, dive->airtemp, " air='", "'"); + if (dive->airtemp.mkelvin && dive->airtemp.mkelvin != dc_airtemp(&dive->dc)) + show_temperature(f, dive->airtemp, " air='", "'"); + if (dive->watertemp.mkelvin && dive->watertemp.mkelvin != dc_watertemp(&dive->dc)) + show_temperature(f, dive->watertemp, " water='", "'"); fputs("/>\n", f); } |