summaryrefslogtreecommitdiffstats
path: root/commands/command_edit.cpp
diff options
context:
space:
mode:
authorGravatar Berthold Stoeger <bstoeger@mail.tuwien.ac.at>2020-03-27 23:21:37 +0100
committerGravatar Dirk Hohndel <dirk@hohndel.org>2020-03-28 10:55:04 -0700
commit10a4225013fc49e8af22d39a4542e8116572b0db (patch)
treec2b533b699436e8702c681c76603e45c2864bd8b /commands/command_edit.cpp
parent76cab71b7c59b938d8999b1abb457182daea5959 (diff)
downloadsubsurface-10a4225013fc49e8af22d39a4542e8116572b0db.tar.gz
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>
Diffstat (limited to 'commands/command_edit.cpp')
-rw-r--r--commands/command_edit.cpp5
1 files changed, 4 insertions, 1 deletions
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