summaryrefslogtreecommitdiffstats
path: root/core/divelist.h
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2016-04-14 05:34:19 -0700
committerGravatar Dirk Hohndel <dirk@hohndel.org>2016-04-14 09:42:10 -0700
commit590af9ae7dced1ca87b38f1ab3774d3a2b678ba1 (patch)
tree98dba41ea7eb8a06f4ae998bd8203d49084b15f3 /core/divelist.h
parent176b92776b45d6f1135441513727cb5f23f49d88 (diff)
downloadsubsurface-590af9ae7dced1ca87b38f1ab3774d3a2b678ba1.tar.gz
Add helper to find the dive closest to a given time
If we want to keep the selected dive "close" to where it was before an operation (whether a delete, or a reload, or something like that), then the most intuitive thing to do appears to be to select either the same dive again (if it still exists), or one very close to it in time. This helper allows us to identify the dive in the current dive list that is closest to the given time. We do this in the C code to ensure that we look at all dives in the dive_table - based on the id that is returned the UI can then figure out where this dive is currently shown. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'core/divelist.h')
-rw-r--r--core/divelist.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/core/divelist.h b/core/divelist.h
index 5bae09cff..7a35fb264 100644
--- a/core/divelist.h
+++ b/core/divelist.h
@@ -48,6 +48,7 @@ extern void set_dive_nr_for_current_dive();
int get_min_datafile_version();
void reset_min_datafile_version();
void report_datafile_version(int version);
+int get_dive_id_closest_to(timestamp_t when);
void clear_dive_file_data();
#ifdef DEBUG_TRIP