mirror of
https://github.com/subsurface/subsurface.git
synced 2024-11-30 22:20:21 +00:00
ec7d85835f
Previously, each dive-list modifying function would lead to a full model reset. Instead, implement proper Qt-model semantics using beginInsertRows()/endInsertRows(), beginRemoveRows()/ endRemoveRows(), dataChange(). To do so, a DiveListNotifer singleton is generatated, which broadcasts all changes to the dive-list. Signals are sent by the commands and received by the DiveTripModel. Signals are batched by dive-trip. This seems to be an adequate compromise for the two kinds of list-views (tree and list). In the common usecase mostly dives of a single trip are affected. Thus, batching of dives is performed in two positions: - At command-level to batch by trip - In DiveTripModel to feed batches of contiguous elements to Qt's begin*/end*-functions. This is conceptually simple, but rather complex code. To avoid repetition of complex loops, the batching is implemented in templated-functions, which are passed lambda-functions, which are called for each batch. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at> |
||
---|---|---|
.. | ||
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 | ||
filtermodels.h | ||
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 |