Map: don't reload map when in edit mode

During edit mode, we could get spurious reload() requests owing
to tabs being hidden. This led to undefined behavior:
In some cases entering dive site edit mode would show all dive
sites, in some only the dive site of the currently edited dive.

Therefore, refuse to reload the map while in edit mode. The
corresponding flag already exists.

Partially fixes #2076

Reported-by: Doug Junkins <junkins@foghead.com>
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
Berthold Stoeger 2019-04-29 07:47:57 +02:00 committed by Dirk Hohndel
parent 743f217620
commit 23cf85e89c

View file

@ -93,6 +93,8 @@ void MapWidget::reload()
void MapWidget::endGetDiveCoordinates()
{
CHECK_IS_READY_RETURN_VOID();
skipReload = false;
m_mapHelper->exitEditMode();
}
@ -100,6 +102,10 @@ void MapWidget::prepareForGetDiveCoordinates(struct dive_site *ds)
{
CHECK_IS_READY_RETURN_VOID();
m_mapHelper->enterEditMode(ds);
// Ignore any reload signals during edit mode to avoid showing all flags when in edit mode.
// This can happen for example when the filter is reset.
skipReload = true;
}
void MapWidget::selectedDivesChanged(QList<int> list)