diff options
author | Tomaz Canabrava <tomaz.canabrava@gmail.com> | 2015-07-30 22:38:28 -0300 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2015-07-31 10:29:33 -0700 |
commit | c13e5d069cefe2015d134d45f9fa9b1f52659eae (patch) | |
tree | 4818928a6fead989468a8500b75160def5f396b3 /qt-ui/locationinformation.cpp | |
parent | f8b64da1365e2919adacc5f928358b474844ebdc (diff) | |
download | subsurface-c13e5d069cefe2015d134d45f9fa9b1f52659eae.tar.gz |
Save the gps edit into the current dive_site
The accept method didn't save the gps edit even if we
put correct text on it.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui/locationinformation.cpp')
-rw-r--r-- | qt-ui/locationinformation.cpp | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/qt-ui/locationinformation.cpp b/qt-ui/locationinformation.cpp index 721e831a6..91ded6c6a 100644 --- a/qt-ui/locationinformation.cpp +++ b/qt-ui/locationinformation.cpp @@ -86,11 +86,17 @@ void LocationInformationWidget::acceptChanges() free(currentDs->notes); currentDs->notes = copy_string(uiString); } + + if (!ui.diveSiteCoordinates->text().isEmpty()) { + double lat, lon; + parseGpsText(ui.diveSiteCoordinates->text(), &lat, &lon); + currentDs->latitude.udeg = lat * 1000000.0; + currentDs->longitude.udeg = lon * 1000000.0; + } if (dive_site_is_empty(currentDs)) { LocationInformationModel::instance()->removeRow(get_divesite_idx(currentDs)); displayed_dive.dive_site_uuid = 0; } - mark_divelist_changed(true); resetState(); emit endRequestCoordinates(); @@ -148,8 +154,6 @@ void LocationInformationWidget::enableEdition() ui.diveSiteMessage->setText(tr("You are editing a dive site")); } -extern bool parseGpsText(const QString &gps_text, double *latitude, double *longitude); - void LocationInformationWidget::on_diveSiteCoordinates_textChanged(const QString& text) { uint lat = displayed_dive_site.latitude.udeg; |