Dive site: don't save invalid GPS coordinates

On the dive site screen, when entering invalid GPS coordinates,
we cleared the location of the dive site. Don't do this. To
clear the location, the user now has to enter the empty string.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
Berthold Stoeger 2020-02-04 10:15:39 +01:00 committed by Dirk Hohndel
parent cabaaa69db
commit 96a03b4b26

View file

@ -267,7 +267,7 @@ void LocationInformationWidget::on_GPSbutton_clicked()
void LocationInformationWidget::on_diveSiteCoordinates_editingFinished()
{
if (diveSite)
if (diveSite && validateGpsText(ui.diveSiteCoordinates->text()))
Command::editDiveSiteLocation(diveSite, parseGpsText(ui.diveSiteCoordinates->text()));
}