mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-08 03:36:15 +00:00
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>
This commit is contained in:
parent
562ee7410c
commit
609688b489
1 changed files with 2 additions and 8 deletions
|
@ -83,15 +83,9 @@ void LocationInformationWidget::setCurrentDiveSite(int dive_nr)
|
||||||
void LocationInformationWidget::setLocationId(uint32_t uuid)
|
void LocationInformationWidget::setLocationId(uint32_t uuid)
|
||||||
{
|
{
|
||||||
currentDs = get_dive_site_by_uuid(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;
|
displayed_dive_site = *currentDs;
|
||||||
if (displayed_dive_site.name)
|
if (displayed_dive_site.name)
|
||||||
ui.diveSiteName->setText(displayed_dive_site.name);
|
ui.diveSiteName->setText(displayed_dive_site.name);
|
||||||
|
|
Loading…
Add table
Reference in a new issue