From d9599589c71d4288dafdbaa58637956a3447c798 Mon Sep 17 00:00:00 2001 From: Berthold Stoeger Date: Wed, 8 Apr 2020 09:05:28 +0200 Subject: fulltext: rename fulltext_reload() to fulltext_populate() This function was named improperly: it was only used on freshly loaded data. Indeed, attempts to use it to actually reload lead to crashes. Signed-off-by: Berthold Stoeger --- core/divelist.c | 2 +- core/fulltext.cpp | 8 ++++---- core/fulltext.h | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/core/divelist.c b/core/divelist.c index a16563310..fa8db6702 100644 --- a/core/divelist.c +++ b/core/divelist.c @@ -831,7 +831,7 @@ void process_loaded_dives() /* Autogroup dives if desired by user. */ autogroup_dives(&dive_table, &trip_table); - fulltext_reload(); + fulltext_populate(); } /* diff --git a/core/fulltext.cpp b/core/fulltext.cpp index 78988b1ab..084b0019b 100644 --- a/core/fulltext.cpp +++ b/core/fulltext.cpp @@ -18,7 +18,7 @@ class FullText { std::map> words; // Dives that belong to each word public: - void reload(); // Rebuild from current dive_table + void populate(); // Rebuild from current dive_table void registerDive(struct dive *d); // Note: can be called repeatedly void unregisterDive(struct dive *d); // Note: can be called repeatedly void unregisterAll(); // Unregister all dives in the dive table @@ -51,9 +51,9 @@ void fulltext_unregister_all() self.unregisterAll(); } -void fulltext_reload() +void fulltext_populate() { - self.reload(); + self.populate(); } } // extern "C" @@ -141,7 +141,7 @@ static std::vector getWords(const dive *d) return res; } -void FullText::reload() +void FullText::populate() { // we want this to be two calls as the second text is overwritten below by the lines starting with "\r" uiNotification(QObject::tr("Create full text index")); diff --git a/core/fulltext.h b/core/fulltext.h index fe6aa333b..108749e1d 100644 --- a/core/fulltext.h +++ b/core/fulltext.h @@ -24,7 +24,7 @@ struct dive; void fulltext_register(struct dive *d); // Note: can be called repeatedly void fulltext_unregister(struct dive *d); // Note: can be called repeatedly void fulltext_unregister_all(); // Unregisters all dives in the dive table -void fulltext_reload(); // Registers all dives in the dive table +void fulltext_populate(); // Registers all dives in the dive table #ifdef __cplusplus } -- cgit v1.2.3-70-g09d2