aboutsummaryrefslogtreecommitdiffstats
path: root/desktop-widgets/mapwidget.cpp
diff options
context:
space:
mode:
authorGravatar Berthold Stoeger <bstoeger@mail.tuwien.ac.at>2019-04-29 07:47:57 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2019-05-11 12:06:19 -0700
commit23cf85e89c7f09281bedd7e704c867049c84cbe8 (patch)
treef05da4f3eb913d20dc94d90acea7e04bfd1ce999 /desktop-widgets/mapwidget.cpp
parent743f217620d8758af658ecfd3f8960ebed0a1427 (diff)
downloadsubsurface-23cf85e89c7f09281bedd7e704c867049c84cbe8.tar.gz
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>
Diffstat (limited to 'desktop-widgets/mapwidget.cpp')
-rw-r--r--desktop-widgets/mapwidget.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/desktop-widgets/mapwidget.cpp b/desktop-widgets/mapwidget.cpp
index b06100c50..bbdf89de2 100644
--- a/desktop-widgets/mapwidget.cpp
+++ b/desktop-widgets/mapwidget.cpp
@@ -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)