From 111968776fa913d06c7c59bfac283da9ab91fe26 Mon Sep 17 00:00:00 2001 From: Tomaz Canabrava Date: Sun, 7 Jun 2015 09:33:53 -0300 Subject: [PATCH] Reset the current dive site when we reject it Signed-off-by: Tomaz Canabrava Signed-off-by: Dirk Hohndel --- qt-ui/locationinformation.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/qt-ui/locationinformation.cpp b/qt-ui/locationinformation.cpp index 9b99d5f91..d332218d8 100644 --- a/qt-ui/locationinformation.cpp +++ b/qt-ui/locationinformation.cpp @@ -116,9 +116,12 @@ void LocationInformationWidget::rejectChanges() LocationInformationModel::instance()->removeRow(get_divesite_idx(currentDs)); if (displayed_dive.dive_site_uuid) { displayed_dive_site = *get_dive_site_by_uuid(displayed_dive.dive_site_uuid); + } else { + displayed_dive_site.uuid = 0; } } else if ((currentDs && dive_site_is_empty(currentDs))) { LocationInformationModel::instance()->removeRow(get_divesite_idx(currentDs)); + displayed_dive_site.uuid = 0; } resetState();