subsurface/qt-models
Berthold Stoeger 979f81f409 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>
2018-08-16 08:07:25 +02:00
..
cleanertablemodel.cpp
cleanertablemodel.h
CMakeLists.txt
completionmodels.cpp
completionmodels.h
cylindermodel.cpp
cylindermodel.h
divecomputerextradatamodel.cpp
divecomputerextradatamodel.h
divecomputermodel.cpp
divecomputermodel.h
diveimportedmodel.cpp
diveimportedmodel.h
divelistmodel.cpp
divelistmodel.h
divelocationmodel.cpp
divelocationmodel.h
divepicturemodel.cpp
divepicturemodel.h
diveplannermodel.cpp
diveplannermodel.h
diveplotdatamodel.cpp
diveplotdatamodel.h
divetripmodel.cpp
divetripmodel.h
filtermodels.cpp Filter: separate backend from frontend logic 2018-08-16 08:07:25 +02:00
filtermodels.h Filter: separate backend from frontend logic 2018-08-16 08:07:25 +02:00
gpslistmodel.cpp
gpslistmodel.h
maplocationmodel.cpp
maplocationmodel.h
messagehandlermodel.cpp
messagehandlermodel.h
models.cpp
models.h
ssrfsortfilterproxymodel.cpp
ssrfsortfilterproxymodel.h
tankinfomodel.cpp
tankinfomodel.h
treemodel.cpp
treemodel.h
weightmodel.cpp
weightmodel.h
weightsysteminfomodel.cpp
weightsysteminfomodel.h
yearlystatisticsmodel.cpp
yearlystatisticsmodel.h