diff options
author | Berthold Stoeger <bstoeger@mail.tuwien.ac.at> | 2019-06-22 20:48:59 +0200 |
---|---|---|
committer | bstoeger <32835590+bstoeger@users.noreply.github.com> | 2019-06-23 20:08:46 +0200 |
commit | cbcddaa396f6668fef7750eb2721bc70ca11d0e4 (patch) | |
tree | 5d0d7abcafbf99c31f4b24a20c94ce1ca4c7e87e /desktop-widgets/command_divesite.cpp | |
parent | 4b0f90ced33569d50913eb9826a8d96fbc4d9f3a (diff) | |
download | subsurface-cbcddaa396f6668fef7750eb2721bc70ca11d0e4.tar.gz |
Dive list: cache shown flag in model (quick-fix for undo-crash)
We have a very fundamental problem with data-duplication in
core and qt-models. In a particular case, this led to an easily
reproducible crash:
1) An undo command moved the last dive of a trip to another.
2) When an undo-command removed the last dive of
a trip to a different trip, the dive was removed from the
trip in the core. Then, the model was updated.
3) That lead at first to a rearrangement of the trips, because
the trip with the added dive is moved before the trip with
the removed dive.
4) In such a case, the filter-model checks the visibility of
the trip.
5) Since the trip with the removed dive has no dives in the core,
visibility was determined as false.
6) From this point on the mappings of the QSortFilterProxyModel
were messed up. Accesses led to crashes. It is unclear
whether this is a Qt bug or only a QOI issue.
As a quick-fix, cache the visibility flag of trips directly
in the Qt-models. Don't set the visibility directly in the
core, but go via the Qt-models. Thus, a more clear layering
is achieved.
In the long run, we can hopefully get rid of the data-duplication
in the models.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'desktop-widgets/command_divesite.cpp')
0 files changed, 0 insertions, 0 deletions