mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +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);
|
free(currentDs->notes);
|
||||||
currentDs->notes = copy_string(uiString);
|
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);
|
mark_divelist_changed(true);
|
||||||
emit informationManagementEnded();
|
emit informationManagementEnded();
|
||||||
}
|
}
|
||||||
|
@ -715,7 +722,13 @@ void LocationInformationWidget::acceptChanges()
|
||||||
void LocationInformationWidget::rejectChanges()
|
void LocationInformationWidget::rejectChanges()
|
||||||
{
|
{
|
||||||
Q_ASSERT(currentDs != NULL);
|
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();
|
emit informationManagementEnded();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue