From 60e0a6e833982522e4f59361cc0349f5935b4d4d Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Wed, 20 Jan 2016 13:56:28 -0800 Subject: 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 --- qt-mobile/qmlmanager.cpp | 8 ++++++-- 1 file 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; -- cgit v1.2.3-70-g09d2