From a221a6e9f5ff7a9460beaa0fbb4da53e5616eca1 Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Wed, 2 Jul 2014 11:50:28 -0700 Subject: UI restructure: use a global variable to hold the dive we show / edit There is massive confusion about what we display when and where and which dive structure (or pointer to a dive structure) contains which information at which stage. This is the first step towards restructuring all of this. This creates a global variable displayed_dive which at any point in time should be what is displayed on screen (both in the profile and in the maintab). It removes the editedDive concept from MainTab. Signed-off-by: Dirk Hohndel --- dive.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'dive.c') diff --git a/dive.c b/dive.c index d6a2b9fd6..d0e7c490f 100644 --- a/dive.c +++ b/dive.c @@ -8,6 +8,11 @@ #include "dive.h" #include "libdivecomputer.h" +/* 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 + * here */ +struct dive displayed_dive; + struct tag_entry *g_tag_list = NULL; static const char *default_tags[] = { -- cgit v1.2.3-70-g09d2