From b3010df14cd241d26898063b155d4f80d538d304 Mon Sep 17 00:00:00 2001 From: Berthold Stoeger Date: Fri, 18 Jan 2019 19:14:43 +0100 Subject: Filter: reinstate dive-site filter functionality Commit 201f0c8f89d6d7df96fd220ea2c0d0977c9b7f20 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 --- qt-models/filtermodels.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'qt-models') diff --git a/qt-models/filtermodels.cpp b/qt-models/filtermodels.cpp index 596bcd98f..6e983c835 100644 --- a/qt-models/filtermodels.cpp +++ b/qt-models/filtermodels.cpp @@ -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; -- cgit v1.2.3-70-g09d2