mirror of
https://github.com/subsurface/subsurface.git
synced 2024-11-28 13:10:19 +00:00
Fix reject changes for add/edit
Reject changes was correct only for Edit, but not for Add. When in add mode we need to retrieve the old dive site, and when in edit mode we should do nothing. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
af22ebf3f1
commit
8ff7826302
1 changed files with 7 additions and 2 deletions
|
@ -113,10 +113,15 @@ void LocationInformationWidget::createDiveSite()
|
|||
|
||||
void LocationInformationWidget::rejectChanges()
|
||||
{
|
||||
if (currentDs && dive_site_is_empty(currentDs)) {
|
||||
if (current_mode == CREATE_DIVE_SITE) {
|
||||
LocationInformationModel::instance()->removeRow(get_divesite_idx(currentDs));
|
||||
if (displayed_dive.dive_site_uuid) {
|
||||
displayed_dive_site = *get_dive_site_by_uuid(displayed_dive.dive_site_uuid);
|
||||
}
|
||||
} else if ((currentDs && dive_site_is_empty(currentDs))) {
|
||||
LocationInformationModel::instance()->removeRow(get_divesite_idx(currentDs));
|
||||
displayed_dive.dive_site_uuid = 0;
|
||||
}
|
||||
|
||||
resetState();
|
||||
emit stopFilterDiveSite();
|
||||
emit informationManagementEnded();
|
||||
|
|
Loading…
Reference in a new issue