From 609688b489ac30fd919c18a7aae1df172570b408 Mon Sep 17 00:00:00 2001 From: Tomaz Canabrava Date: Tue, 26 May 2015 17:02:50 -0300 Subject: Do not create a new dive site when curr is invalid We will however create a new dive site when the user clicks on the add button - creating it here would led to strange behavior. Signed-off-by: Tomaz Canabrava Signed-off-by: Dirk Hohndel --- qt-ui/locationinformation.cpp | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) (limited to 'qt-ui/locationinformation.cpp') diff --git a/qt-ui/locationinformation.cpp b/qt-ui/locationinformation.cpp index 67fb5d5ac..3ee9dd746 100644 --- a/qt-ui/locationinformation.cpp +++ b/qt-ui/locationinformation.cpp @@ -83,15 +83,9 @@ void LocationInformationWidget::setCurrentDiveSite(int dive_nr) void LocationInformationWidget::setLocationId(uint32_t uuid) { currentDs = get_dive_site_by_uuid(uuid); + if(!currentDs) + return; - if (!currentDs) { - currentDs = get_dive_site_by_uuid(create_dive_site("")); - displayed_dive.dive_site_uuid = currentDs->uuid; - ui.diveSiteName->clear(); - ui.diveSiteDescription->clear(); - ui.diveSiteNotes->clear(); - ui.diveSiteCoordinates->clear(); - } displayed_dive_site = *currentDs; if (displayed_dive_site.name) ui.diveSiteName->setText(displayed_dive_site.name); -- cgit v1.2.3-70-g09d2