From 219420bd6e1648596aa4a3324d3f39bb3d791be7 Mon Sep 17 00:00:00 2001 From: Berthold Stoeger Date: Mon, 16 Mar 2020 23:10:47 +0100 Subject: filter: update fulltext index when editing dive In edit commands, the fulltext might have changed and therefore we have to update the fulltext index. Signed-off-by: Berthold Stoeger --- commands/command_edit.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'commands/command_edit.cpp') diff --git a/commands/command_edit.cpp b/commands/command_edit.cpp index 6a5e165be..32c478845 100644 --- a/commands/command_edit.cpp +++ b/commands/command_edit.cpp @@ -2,6 +2,7 @@ #include "command_edit.h" #include "core/divelist.h" +#include "core/fulltext.h" #include "core/qthelper.h" // for copy_qstring #include "core/selection.h" #include "core/subsurface-string.h" @@ -108,6 +109,7 @@ void EditBase::undo() for (dive *d: dives) { set(d, value); + fulltext_register(d); // Update the fulltext cache invalidate_dive_cache(d); // Ensure that dive is written in git_save() } @@ -678,8 +680,9 @@ void EditTagsBase::undo() if (!tags.contains(tag)) tags.push_back(tag); } - invalidate_dive_cache(d); // Ensure that dive is written in git_save() set(d, tags); + fulltext_register(d); // Update the fulltext cache + invalidate_dive_cache(d); // Ensure that dive is written in git_save() } std::swap(tagsToAdd, tagsToRemove); -- cgit v1.2.3-70-g09d2