mirror of
https://github.com/subsurface/subsurface.git
synced 2024-11-30 22:20:21 +00:00
map: fold selectionChanged() into setSelection()
This was very weird: a setSelection() call was always followed by a selectionChanged() call, though sometimes in convoluted ways. Notably, the formed was called by the DiveListView, the lattern then by the MainWindow. Let's just merge these two functions. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
parent
72a15c46d9
commit
de2c4d93e0
6 changed files with 2 additions and 18 deletions
|
@ -181,7 +181,6 @@ void DiveFilter::setFilterDiveSite(QVector<dive_site *> ds)
|
||||||
emit diveListNotifier.filterReset();
|
emit diveListNotifier.filterReset();
|
||||||
#ifdef MAP_SUPPORT
|
#ifdef MAP_SUPPORT
|
||||||
MapWidget::instance()->setSelected(dive_sites);
|
MapWidget::instance()->setSelected(dive_sites);
|
||||||
MapWidget::instance()->selectionChanged();
|
|
||||||
#endif
|
#endif
|
||||||
MainWindow::instance()->diveList->expandAll();
|
MainWindow::instance()->diveList->expandAll();
|
||||||
}
|
}
|
||||||
|
|
|
@ -337,9 +337,6 @@ void MainWindow::divesSelected(const std::vector<dive *> &selection, dive *curre
|
||||||
if (currentDive)
|
if (currentDive)
|
||||||
enableDisableOtherDCsActions();
|
enableDisableOtherDCsActions();
|
||||||
profile->plotCurrentDive();
|
profile->plotCurrentDive();
|
||||||
#ifdef MAP_SUPPORT
|
|
||||||
MapWidget::instance()->selectionChanged();
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::on_actionNew_triggered()
|
void MainWindow::on_actionNew_triggered()
|
||||||
|
|
|
@ -83,12 +83,6 @@ void MapWidget::setSelected(const QVector<dive_site *> &divesites)
|
||||||
{
|
{
|
||||||
CHECK_IS_READY_RETURN_VOID();
|
CHECK_IS_READY_RETURN_VOID();
|
||||||
m_mapHelper->setSelected(divesites);
|
m_mapHelper->setSelected(divesites);
|
||||||
}
|
|
||||||
|
|
||||||
void MapWidget::selectionChanged()
|
|
||||||
{
|
|
||||||
CHECK_IS_READY_RETURN_VOID();
|
|
||||||
m_mapHelper->selectionChanged();
|
|
||||||
m_mapHelper->centerOnSelectedDiveSite();
|
m_mapHelper->centerOnSelectedDiveSite();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -23,7 +23,6 @@ public:
|
||||||
|
|
||||||
static MapWidget *instance();
|
static MapWidget *instance();
|
||||||
void reload();
|
void reload();
|
||||||
void selectionChanged();
|
|
||||||
void setSelected(const QVector<dive_site *> &divesites);
|
void setSelected(const QVector<dive_site *> &divesites);
|
||||||
bool editMode() const;
|
bool editMode() const;
|
||||||
|
|
||||||
|
|
|
@ -49,6 +49,8 @@ void MapWidgetHelper::centerOnDiveSite(struct dive_site *ds)
|
||||||
void MapWidgetHelper::setSelected(const QVector<dive_site *> &divesites)
|
void MapWidgetHelper::setSelected(const QVector<dive_site *> &divesites)
|
||||||
{
|
{
|
||||||
m_mapLocationModel->setSelected(divesites);
|
m_mapLocationModel->setSelected(divesites);
|
||||||
|
m_mapLocationModel->selectionChanged();
|
||||||
|
updateEditMode();
|
||||||
}
|
}
|
||||||
|
|
||||||
void MapWidgetHelper::centerOnSelectedDiveSite()
|
void MapWidgetHelper::centerOnSelectedDiveSite()
|
||||||
|
@ -118,12 +120,6 @@ void MapWidgetHelper::reloadMapLocations()
|
||||||
m_mapLocationModel->reload(m_map);
|
m_mapLocationModel->reload(m_map);
|
||||||
}
|
}
|
||||||
|
|
||||||
void MapWidgetHelper::selectionChanged()
|
|
||||||
{
|
|
||||||
updateEditMode();
|
|
||||||
m_mapLocationModel->selectionChanged();
|
|
||||||
}
|
|
||||||
|
|
||||||
void MapWidgetHelper::selectedLocationChanged(struct dive_site *ds_in)
|
void MapWidgetHelper::selectedLocationChanged(struct dive_site *ds_in)
|
||||||
{
|
{
|
||||||
int idx;
|
int idx;
|
||||||
|
|
|
@ -36,7 +36,6 @@ public:
|
||||||
Q_INVOKABLE void updateCurrentDiveSiteCoordinatesFromMap(struct dive_site *ds, QGeoCoordinate coord);
|
Q_INVOKABLE void updateCurrentDiveSiteCoordinatesFromMap(struct dive_site *ds, QGeoCoordinate coord);
|
||||||
Q_INVOKABLE void selectVisibleLocations();
|
Q_INVOKABLE void selectVisibleLocations();
|
||||||
Q_INVOKABLE void selectedLocationChanged(struct dive_site *ds);
|
Q_INVOKABLE void selectedLocationChanged(struct dive_site *ds);
|
||||||
void selectionChanged();
|
|
||||||
void setSelected(const QVector<dive_site *> &divesites);
|
void setSelected(const QVector<dive_site *> &divesites);
|
||||||
QString pluginObject();
|
QString pluginObject();
|
||||||
bool editMode() const;
|
bool editMode() const;
|
||||||
|
|
Loading…
Reference in a new issue