Reset the current dive site when we reject it

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Tomaz Canabrava 2015-06-07 09:33:53 -03:00 committed by Dirk Hohndel
parent 03147d69ba
commit 111968776f

View file

@ -116,9 +116,12 @@ void LocationInformationWidget::rejectChanges()
LocationInformationModel::instance()->removeRow(get_divesite_idx(currentDs)); LocationInformationModel::instance()->removeRow(get_divesite_idx(currentDs));
if (displayed_dive.dive_site_uuid) { if (displayed_dive.dive_site_uuid) {
displayed_dive_site = *get_dive_site_by_uuid(displayed_dive.dive_site_uuid); displayed_dive_site = *get_dive_site_by_uuid(displayed_dive.dive_site_uuid);
} else {
displayed_dive_site.uuid = 0;
} }
} else if ((currentDs && dive_site_is_empty(currentDs))) { } else if ((currentDs && dive_site_is_empty(currentDs))) {
LocationInformationModel::instance()->removeRow(get_divesite_idx(currentDs)); LocationInformationModel::instance()->removeRow(get_divesite_idx(currentDs));
displayed_dive_site.uuid = 0;
} }
resetState(); resetState();