diff options
author | Berthold Stoeger <bstoeger@mail.tuwien.ac.at> | 2018-08-14 18:30:49 -0400 |
---|---|---|
committer | Berthold Stoeger <bstoeger@mail.tuwien.ac.at> | 2018-08-16 08:07:25 +0200 |
commit | 979f81f4090de1a4e828d2f6c1e5bc810d5e8b58 (patch) | |
tree | eb5dc3c3c0de7136d87dc02467aa41c70d0fab0e /desktop-widgets/usersurvey.cpp | |
parent | 13fbca3f5522e31a81aaad0cfc830ee751918c31 (diff) | |
download | subsurface-979f81f4090de1a4e828d2f6c1e5bc810d5e8b58.tar.gz |
Filter: separate backend from frontend logic
The filter code was an unholy intermixture of backend and frontend
logic, which made it hard to access it from outside of the UI.
Notably, it expected that Qt would call filterAcceptsRow on all rows.
For trip-view, apparently the filter functions were called twice
(once for filtering the trip, then for filtering the individual dives).
Make the filtering explicit, by calling showDive() for all dives in
MultiFilterSortModel::myInvalidate(), setting the hidden_by_filter
flags accordingly and ultimately invalidating the filter.
The UI code only accesses the hidden_by_filter flag set previously.
The "justCleared" flag can then be removed, since accessing the filter
does not have side effects. Moreover, there is no noticeable performance
gain by returning out early.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'desktop-widgets/usersurvey.cpp')
0 files changed, 0 insertions, 0 deletions