mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-01 14:03:24 +00:00
make GPS coordinates autofilling really work
Move the gpsHasChanged() call on selected dive when coordinates have changed *before* autofilling, otherwise it erases the autofilled values. Also update displayed_dive when autofilling, otherwise values are stored but not displayed immediately after saving. Signed-off-by: Gaetan Bisson <bisson@archlinux.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
f79c659b10
commit
c054b18b70
1 changed files with 6 additions and 4 deletions
|
@ -690,6 +690,10 @@ void MainTab::acceptChanges()
|
||||||
time_t offset = current_dive->when - displayed_dive.when;
|
time_t offset = current_dive->when - displayed_dive.when;
|
||||||
MODIFY_SELECTED_DIVES(mydive->when -= offset;);
|
MODIFY_SELECTED_DIVES(mydive->when -= offset;);
|
||||||
}
|
}
|
||||||
|
if (displayed_dive.latitude.udeg != current_dive->latitude.udeg ||
|
||||||
|
displayed_dive.longitude.udeg != current_dive->longitude.udeg) {
|
||||||
|
MODIFY_SELECTED_DIVES(gpsHasChanged(mydive, cd, ui.coordinates->text(), 0));
|
||||||
|
}
|
||||||
if (!same_string(displayed_dive.location, cd->location)) {
|
if (!same_string(displayed_dive.location, cd->location)) {
|
||||||
MODIFY_SELECTED_DIVES(EDIT_TEXT(location));
|
MODIFY_SELECTED_DIVES(EDIT_TEXT(location));
|
||||||
// if we have a location text and haven't edited the coordinates, try to fill the coordinates
|
// if we have a location text and haven't edited the coordinates, try to fill the coordinates
|
||||||
|
@ -707,16 +711,14 @@ void MainTab::acceptChanges()
|
||||||
mydive->latitude = dive->latitude;
|
mydive->latitude = dive->latitude;
|
||||||
mydive->longitude = dive->longitude;
|
mydive->longitude = dive->longitude;
|
||||||
});
|
});
|
||||||
|
displayed_dive.latitude = dive->latitude;
|
||||||
|
displayed_dive.longitude = dive->longitude;
|
||||||
MainWindow::instance()->globe()->reload();
|
MainWindow::instance()->globe()->reload();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (displayed_dive.latitude.udeg != current_dive->latitude.udeg ||
|
|
||||||
displayed_dive.longitude.udeg != current_dive->longitude.udeg) {
|
|
||||||
MODIFY_SELECTED_DIVES(gpsHasChanged(mydive, cd, ui.coordinates->text(), 0));
|
|
||||||
}
|
|
||||||
if (tagsChanged(&displayed_dive, cd))
|
if (tagsChanged(&displayed_dive, cd))
|
||||||
saveTags();
|
saveTags();
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue