mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
mobile: fix filter flag when editing dives
When editing dives, the undo-command sends a filte changed signal. The models catch the signal and check whether the filter status changed. The mobile-version of the dive-edit command simply exchanged the dives. This could lead to inconsistencies when the filter flag was overwritten. Therefore, make sure that the filter flag is not overwritten by the dive-exchange. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
parent
fbf99c0105
commit
76cab71b7c
1 changed files with 6 additions and 0 deletions
|
@ -1242,6 +1242,12 @@ void EditDive::redo()
|
||||||
|
|
||||||
void EditDive::exchangeDives()
|
void EditDive::exchangeDives()
|
||||||
{
|
{
|
||||||
|
// Set the filter flag of the new dive to the old dive.
|
||||||
|
// Reason: When we send the dive-changed signal, the model will
|
||||||
|
// track the *change* of the filter flag, so we must not overwrite
|
||||||
|
// it by swapping the dive data.
|
||||||
|
newDive->hidden_by_filter = oldDive->hidden_by_filter;
|
||||||
|
|
||||||
// Bluntly exchange dive data by shallow copy
|
// Bluntly exchange dive data by shallow copy
|
||||||
std::swap(*newDive, *oldDive);
|
std::swap(*newDive, *oldDive);
|
||||||
invalidate_dive_cache(oldDive);
|
invalidate_dive_cache(oldDive);
|
||||||
|
|
Loading…
Add table
Reference in a new issue