summaryrefslogtreecommitdiffstats
path: root/core/dive.c
diff options
context:
space:
mode:
authorGravatar Berthold Stoeger <bstoeger@mail.tuwien.ac.at>2020-02-16 22:26:47 +0100
committerGravatar Dirk Hohndel <dirk@hohndel.org>2020-03-01 10:21:44 -0800
commitd3f6e032cc25f9360049f9821cb4b9f055b28feb (patch)
tree49b5f777dd6c018e4c82c514050f39d0c46de1a9 /core/dive.c
parent6434ad262887a473abd410fd8011bba1291663d6 (diff)
downloadsubsurface-d3f6e032cc25f9360049f9821cb4b9f055b28feb.tar.gz
filter: index/unindex dives on loading or clearing logs
When loading dive data, populate the fulltext index. When clearing dive data, free the fulltext index. When deleting a dive, remove it from the fulltext index. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'core/dive.c')
-rw-r--r--core/dive.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/core/dive.c b/core/dive.c
index 65398cade..e1bf92e0a 100644
--- a/core/dive.c
+++ b/core/dive.c
@@ -17,6 +17,10 @@
#include "tag.h"
#include "trip.h"
#include "structured_list.h"
+#ifndef SUBSURFACE_MOBILE
+#include "fulltext.h"
+#endif
+
/* one could argue about the best place to have this variable -
* it's used in the UI, but it seems to make the most sense to have it
@@ -356,6 +360,9 @@ static void free_dive_structures(struct dive *d)
{
if (!d)
return;
+#ifndef SUBSURFACE_MOBILE
+ fulltext_unregister(d);
+#endif
/* free the strings */
free(d->buddy);
free(d->divemaster);
@@ -401,6 +408,9 @@ static void copy_dive_nodc(const struct dive *s, struct dive *d)
*d = *s;
memset(&d->cylinders, 0, sizeof(d->cylinders));
memset(&d->weightsystems, 0, sizeof(d->weightsystems));
+#ifndef SUBSURFACE_MOBILE
+ d->full_text = NULL;
+#endif
invalidate_dive_cache(d);
d->buddy = copy_string(s->buddy);
d->divemaster = copy_string(s->divemaster);