Filter: reinstate dive-site filter functionality

Commit 201f0c8f89 removed the dive-site
filtering. This is needed for dive-site editing: The list should only
show dives at the corresponding dive-site.

As opposed to the original code, only compare for the actual dive-site,
not for the name of the dive-site. The reason for comparing dive-site
names is unknown.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
Berthold Stoeger 2019-01-18 19:14:43 +01:00 committed by Dirk Hohndel
parent 37a521eb5d
commit b3010df14c

View file

@ -100,6 +100,10 @@ void MultiFilterSortModel::resetModel(DiveTripModelBase::Layout layout)
bool MultiFilterSortModel::showDive(const struct dive *d) const
{
// If curr_dive_site is set, we are in a special dive-site editing mode.
if (curr_dive_site)
return d->dive_site == curr_dive_site;
if (!filterData.validFilter)
return true;