summaryrefslogtreecommitdiffstats
path: root/core/divelist.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/divelist.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/divelist.c')
-rw-r--r--core/divelist.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/core/divelist.c b/core/divelist.c
index 6995c4c50..5a60594d7 100644
--- a/core/divelist.c
+++ b/core/divelist.c
@@ -5,6 +5,7 @@
#include "deco.h"
#include "divesite.h"
#include "divelist.h"
+#include "fulltext.h"
#include "planner.h"
#include "qthelper.h"
#include "gettext.h"
@@ -829,6 +830,10 @@ void process_loaded_dives()
/* Autogroup dives if desired by user. */
autogroup_dives(&dive_table, &trip_table);
+
+#ifndef SUBSURFACE_MOBILE
+ fulltext_reload();
+#endif
}
/*
@@ -1338,6 +1343,10 @@ int get_dive_id_closest_to(timestamp_t when)
void clear_dive_file_data()
{
+#ifndef SUBSURFACE_MOBILE
+ fulltext_unregister_all();
+#endif
+
while (dive_table.nr)
delete_single_dive(0);
current_dive = NULL;