diff options
author | Dirk Hohndel <dirk@hohndel.org> | 2016-01-20 13:56:28 -0800 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2016-01-20 13:56:28 -0800 |
commit | 60e0a6e833982522e4f59361cc0349f5935b4d4d (patch) | |
tree | 042771b13ae485e92acea16668564d243ba7047b /qt-mobile/qmlmanager.cpp | |
parent | a329d44de091939c0a972433811e9889d1739c2c (diff) | |
download | subsurface-60e0a6e833982522e4f59361cc0349f5935b4d4d.tar.gz |
QML UI: fix bugs in change detection on dive edit
We were comparing apples to oranges on a few items and therefore more or less
always assumed that a dive had been modified.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-mobile/qmlmanager.cpp')
-rw-r--r-- | qt-mobile/qmlmanager.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/qt-mobile/qmlmanager.cpp b/qt-mobile/qmlmanager.cpp index ecaca047f..a84e46dd4 100644 --- a/qt-mobile/qmlmanager.cpp +++ b/qt-mobile/qmlmanager.cpp @@ -433,7 +433,9 @@ QString QMLManager::commitChanges(QString diveId, QString date, QString location if (same_string(d->dc.model, "manually added dive")) d->dc.maxdepth.mm = d->maxdepth.mm; } - if (get_temperature_string(d->airtemp) != airtemp) { + if (airtemp == "--") + airtemp = ""; + if (get_temperature_string(d->airtemp, true) != airtemp) { diveChanged = true; if (airtemp.contains(tr("C"))) prefs.units.temperature = units::CELSIUS; @@ -441,7 +443,9 @@ QString QMLManager::commitChanges(QString diveId, QString date, QString location prefs.units.temperature = units::FAHRENHEIT; d->airtemp.mkelvin = parseTemperatureToMkelvin(airtemp); } - if (get_temperature_string(d->watertemp) != watertemp) { + if (watertemp == "--") + watertemp = ""; + if (get_temperature_string(d->watertemp, true) != watertemp) { diveChanged = true; if (watertemp.contains(tr("C"))) prefs.units.temperature = units::CELSIUS; |