From 10a4225013fc49e8af22d39a4542e8116572b0db Mon Sep 17 00:00:00 2001 From: Berthold Stoeger Date: Fri, 27 Mar 2020 23:21:37 +0100 Subject: 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 Signed-off-by: Berthold Stoeger --- commands/command_edit.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'commands') diff --git a/commands/command_edit.cpp b/commands/command_edit.cpp index 194264531..c5f0e6a7a 100644 --- a/commands/command_edit.cpp +++ b/commands/command_edit.cpp @@ -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 -- cgit v1.2.3-70-g09d2