mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
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:
parent
2da7b6d0f5
commit
219420bd6e
1 changed files with 4 additions and 1 deletions
|
@ -2,6 +2,7 @@
|
||||||
|
|
||||||
#include "command_edit.h"
|
#include "command_edit.h"
|
||||||
#include "core/divelist.h"
|
#include "core/divelist.h"
|
||||||
|
#include "core/fulltext.h"
|
||||||
#include "core/qthelper.h" // for copy_qstring
|
#include "core/qthelper.h" // for copy_qstring
|
||||||
#include "core/selection.h"
|
#include "core/selection.h"
|
||||||
#include "core/subsurface-string.h"
|
#include "core/subsurface-string.h"
|
||||||
|
@ -108,6 +109,7 @@ void EditBase<T>::undo()
|
||||||
|
|
||||||
for (dive *d: dives) {
|
for (dive *d: dives) {
|
||||||
set(d, value);
|
set(d, value);
|
||||||
|
fulltext_register(d); // Update the fulltext cache
|
||||||
invalidate_dive_cache(d); // Ensure that dive is written in git_save()
|
invalidate_dive_cache(d); // Ensure that dive is written in git_save()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -678,8 +680,9 @@ void EditTagsBase::undo()
|
||||||
if (!tags.contains(tag))
|
if (!tags.contains(tag))
|
||||||
tags.push_back(tag);
|
tags.push_back(tag);
|
||||||
}
|
}
|
||||||
invalidate_dive_cache(d); // Ensure that dive is written in git_save()
|
|
||||||
set(d, tags);
|
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);
|
std::swap(tagsToAdd, tagsToRemove);
|
||||||
|
|
Loading…
Add table
Reference in a new issue