aboutsummaryrefslogtreecommitdiffstats
path: root/qt-ui/locationinformation.cpp
diff options
context:
space:
mode:
authorGravatar Tomaz Canabrava <tomaz.canabrava@intel.com>2015-05-26 17:02:50 -0300
committerGravatar Dirk Hohndel <dirk@hohndel.org>2015-05-26 21:47:02 -0700
commit609688b489ac30fd919c18a7aae1df172570b408 (patch)
tree701f53486071449cd53f316d5717863466f3d695 /qt-ui/locationinformation.cpp
parent562ee7410caba9b4f7aeb24fafc5c6a7b3c36914 (diff)
downloadsubsurface-609688b489ac30fd919c18a7aae1df172570b408.tar.gz
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 <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui/locationinformation.cpp')
-rw-r--r--qt-ui/locationinformation.cpp10
1 files changed, 2 insertions, 8 deletions
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);