diff options
author | Berthold Stoeger <bstoeger@mail.tuwien.ac.at> | 2020-04-08 09:05:28 +0200 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2020-04-08 08:08:19 -0700 |
commit | d9599589c71d4288dafdbaa58637956a3447c798 (patch) | |
tree | d19f508de03424ad27e139cd1fe1c0928b2a5a4b | |
parent | d8b92a18520a58646180e6b91cafd89dbb997fcb (diff) | |
download | subsurface-d9599589c71d4288dafdbaa58637956a3447c798.tar.gz |
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 <bstoeger@mail.tuwien.ac.at>
-rw-r--r-- | core/divelist.c | 2 | ||||
-rw-r--r-- | core/fulltext.cpp | 8 | ||||
-rw-r--r-- | 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<QString, std::vector<dive *>> 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<QString> 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 } |