mobile: when editing dives update the fulltext filter

In the mobile version of the dive-editing command, the fulltext
filter was not updated. Thus, when editing a dive while the filter
was active, the dive would disappear.

Unregister the old and register the new version.

Reported-by: Chirana Gheorghita Eugeniu Theodor <office@adaptcom.ro>
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
Berthold Stoeger 2020-03-27 23:21:37 +01:00 committed by Dirk Hohndel
parent 76cab71b7c
commit 10a4225013

View file

@ -1248,8 +1248,11 @@ void EditDive::exchangeDives()
// 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.
// Don't forget to unregister the old and register the new dive!
fulltext_unregister(oldDive);
std::swap(*newDive, *oldDive);
fulltext_register(oldDive);
invalidate_dive_cache(oldDive);
// Changing times may have unsorted the dive and trip tables