diff options
author | Berthold Stoeger <bstoeger@mail.tuwien.ac.at> | 2018-10-26 16:57:08 +0200 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2018-10-29 00:09:31 +0000 |
commit | acd44467c1100a1a774cc644921b1dc33dca1266 (patch) | |
tree | 819d967b4d41c5b72d357f00d69826b743f07e6f /desktop-widgets/locationinformation.cpp | |
parent | f41bb32428f1e6377b7b293215e8c2f71fa06c9a (diff) | |
download | subsurface-acd44467c1100a1a774cc644921b1dc33dca1266.tar.gz |
Dive site: remove [start|stop]FilterDiveSite signals
This is another case of a weird pattern where an object would
connect it's own signal to the slot of a different object.
There seems to be no reason why the former couldn't simply
call the latter.
Remove the [start|stop]FilterDiveSite signals of LocationInformationWidget
and call the corresponding functions of MultiFilterSortModel directly.
While doing so, replace the UUID argument by a pointer-to-divesite.
It will be converted anyway right at the beginning of the function.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'desktop-widgets/locationinformation.cpp')
-rw-r--r-- | desktop-widgets/locationinformation.cpp | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/desktop-widgets/locationinformation.cpp b/desktop-widgets/locationinformation.cpp index 65ccfa7f0..e48c46008 100644 --- a/desktop-widgets/locationinformation.cpp +++ b/desktop-widgets/locationinformation.cpp @@ -33,8 +33,6 @@ LocationInformationWidget::LocationInformationWidget(QWidget *parent) : QGroupBo ui.diveSiteMessage->addAction(acceptAction); ui.diveSiteMessage->addAction(rejectAction); - connect(this, SIGNAL(startFilterDiveSite(uint32_t)), MultiFilterSortModel::instance(), SLOT(startFilterDiveSite(uint32_t))); - connect(this, SIGNAL(stopFilterDiveSite()), MultiFilterSortModel::instance(), SLOT(stopFilterDiveSite())); connect(ui.geoCodeButton, SIGNAL(clicked()), this, SLOT(reverseGeocode())); connect(this, SIGNAL(nameChanged(const QString &, const QString &)), LocationFilterModel::instance(), SLOT(changeName(const QString &, const QString &))); @@ -229,7 +227,7 @@ void LocationInformationWidget::initFields(dive_site *ds) updateLabels(); enableLocationButtons(dive_site_has_gps_location(ds)); QSortFilterProxyModel *m = qobject_cast<QSortFilterProxyModel *>(ui.diveSiteListView->model()); - emit startFilterDiveSite(ds->uuid); + MultiFilterSortModel::instance()->startFilterDiveSite(ds); if (m) m->invalidate(); } else { @@ -261,7 +259,7 @@ void LocationInformationWidget::resetState() ui.diveSiteMessage->setText(tr("Dive site management")); MapWidget::instance()->endGetDiveCoordinates(); MapWidget::instance()->repopulateLabels(); - emit stopFilterDiveSite(); + MultiFilterSortModel::instance()->stopFilterDiveSite(); emit endEditDiveSite(); updateLocationOnMap(); } |