summaryrefslogtreecommitdiffstats
path: root/desktop-widgets/mapwidget.cpp
diff options
context:
space:
mode:
authorGravatar Lubomir I. Ivanov <neolit123@gmail.com>2017-07-24 22:47:37 +0300
committerGravatar Dirk Hohndel <dirk@hohndel.org>2017-07-28 07:31:11 -0700
commit7486682f43b2c83d02bed52a2a6c3c7ce8d68426 (patch)
tree17820444683219f90e08182b6c74ef3d61faf340 /desktop-widgets/mapwidget.cpp
parent64697375cf4dc2bda7db3f4846a500d4e30f6fc4 (diff)
downloadsubsurface-7486682f43b2c83d02bed52a2a6c3c7ce8d68426.tar.gz
mapwidget: add the "skipReload" guard
This guard is to prevent a meaningless reload on the map marker list, when the user selects a new dive and nearby dives. The flag is updated in selectedDivesChanged() which on it's now cannot possibly trigger changes in the markers, only the selection. The selection of active flags is already handled by the model and automatically updated in the QML. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Diffstat (limited to 'desktop-widgets/mapwidget.cpp')
-rw-r--r--desktop-widgets/mapwidget.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/desktop-widgets/mapwidget.cpp b/desktop-widgets/mapwidget.cpp
index d5a926f59..4ac394b4e 100644
--- a/desktop-widgets/mapwidget.cpp
+++ b/desktop-widgets/mapwidget.cpp
@@ -12,6 +12,8 @@
#include "mainwindow.h"
#include "divelistview.h"
+static bool skipReload = false;
+
MapWidget *MapWidget::m_instance = NULL;
MapWidget::MapWidget(QWidget *parent) : QQuickWidget(parent)
@@ -50,7 +52,8 @@ void MapWidget::repopulateLabels()
void MapWidget::reload()
{
- m_mapHelper->reloadMapLocations();
+ if (!skipReload)
+ m_mapHelper->reloadMapLocations();
}
void MapWidget::endGetDiveCoordinates()
@@ -66,11 +69,11 @@ void MapWidget::prepareForGetDiveCoordinates()
void MapWidget::selectedDivesChanged(QList<int> list)
{
qDebug() << "onSelectedDivesChanged:" << list.size();
- /*
+ skipReload = true;
MainWindow::instance()->dive_list()->unselectDives();
if (!list.empty())
MainWindow::instance()->dive_list()->selectDives(list);
- */
+ skipReload = false;
}
MapWidget::~MapWidget()