mirror of
https://github.com/subsurface/subsurface.git
synced 2025-01-19 14:25:27 +00:00
Cleanup: access filter-model directly without cast
To reset the filter-model, LocationInformationWidget would extract the model from the diveSiteListView and then downcasts it. Instead, it can access it directly, because the filter-model is a subobject of LocationInformationWidget. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
parent
f09177e872
commit
5b270dd895
1 changed files with 1 additions and 3 deletions
|
@ -194,10 +194,8 @@ void LocationInformationWidget::initFields(dive_site *ds)
|
||||||
filter_model.set(ds, ds->location);
|
filter_model.set(ds, ds->location);
|
||||||
updateLabels();
|
updateLabels();
|
||||||
enableLocationButtons(dive_site_has_gps_location(ds));
|
enableLocationButtons(dive_site_has_gps_location(ds));
|
||||||
QSortFilterProxyModel *m = qobject_cast<QSortFilterProxyModel *>(ui.diveSiteListView->model());
|
|
||||||
MultiFilterSortModel::instance()->startFilterDiveSites(QVector<dive_site *>{ ds });
|
MultiFilterSortModel::instance()->startFilterDiveSites(QVector<dive_site *>{ ds });
|
||||||
if (m)
|
filter_model.invalidate();
|
||||||
m->invalidate();
|
|
||||||
} else {
|
} else {
|
||||||
filter_model.set(0, location_t { degrees_t{ 0 }, degrees_t{ 0 } });
|
filter_model.set(0, location_t { degrees_t{ 0 }, degrees_t{ 0 } });
|
||||||
clearLabels();
|
clearLabels();
|
||||||
|
|
Loading…
Add table
Reference in a new issue