mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
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>
This commit is contained in:
parent
a329d44de0
commit
60e0a6e833
1 changed files with 6 additions and 2 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Reference in a new issue