summaryrefslogtreecommitdiffstats
path: root/qt-ui/locationinformation.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'qt-ui/locationinformation.cpp')
-rw-r--r--qt-ui/locationinformation.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/qt-ui/locationinformation.cpp b/qt-ui/locationinformation.cpp
index 17eccf5f2..9f1262bb3 100644
--- a/qt-ui/locationinformation.cpp
+++ b/qt-ui/locationinformation.cpp
@@ -113,10 +113,15 @@ void LocationInformationWidget::createDiveSite()
void LocationInformationWidget::rejectChanges()
{
- if (currentDs && dive_site_is_empty(currentDs)) {
+ if (current_mode == CREATE_DIVE_SITE) {
+ 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 if ((currentDs && dive_site_is_empty(currentDs))) {
LocationInformationModel::instance()->removeRow(get_divesite_idx(currentDs));
- displayed_dive.dive_site_uuid = 0;
}
+
resetState();
emit stopFilterDiveSite();
emit informationManagementEnded();