mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-01 02:53:24 +00:00
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>
This commit is contained in:
parent
64697375cf
commit
7486682f43
1 changed files with 6 additions and 3 deletions
|
@ -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()
|
||||
|
|
Loading…
Add table
Reference in a new issue