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 <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
Berthold Stoeger 2020-03-16 23:10:47 +01:00 committed by Dirk Hohndel
parent 2da7b6d0f5
commit 219420bd6e

View file

@ -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<T>::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);