mirror of
https://github.com/subsurface/subsurface.git
synced 2024-11-30 22:20:21 +00:00
Don't add empty dive sites
It makes no sense to keep them around, it makes no sense to have dives refer to them. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
7ca3d859dc
commit
3ea2e15bd2
1 changed files with 14 additions and 1 deletions
|
@ -708,6 +708,13 @@ void LocationInformationWidget::acceptChanges()
|
|||
free(currentDs->notes);
|
||||
currentDs->notes = copy_string(uiString);
|
||||
}
|
||||
if (dive_site_is_empty(currentDs)) {
|
||||
delete_dive_site(currentDs->uuid);
|
||||
displayed_dive.dive_site_uuid = 0;
|
||||
setLocationId(0);
|
||||
} else {
|
||||
setLocationId(currentDs->uuid);
|
||||
}
|
||||
mark_divelist_changed(true);
|
||||
emit informationManagementEnded();
|
||||
}
|
||||
|
@ -715,7 +722,13 @@ void LocationInformationWidget::acceptChanges()
|
|||
void LocationInformationWidget::rejectChanges()
|
||||
{
|
||||
Q_ASSERT(currentDs != NULL);
|
||||
setLocationId(currentDs->uuid);
|
||||
if (dive_site_is_empty(currentDs)) {
|
||||
delete_dive_site(currentDs->uuid);
|
||||
displayed_dive.dive_site_uuid = 0;
|
||||
setLocationId(0);
|
||||
} else {
|
||||
setLocationId(currentDs->uuid);
|
||||
}
|
||||
emit informationManagementEnded();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue