diff options
-rw-r--r-- | core/cochran.c | 1 | ||||
-rw-r--r-- | core/dive.h | 1 | ||||
-rw-r--r-- | core/libdivecomputer.c | 1 | ||||
-rw-r--r-- | core/liquivision.c | 1 | ||||
-rw-r--r-- | core/uemis-downloader.c | 11 |
5 files changed, 5 insertions, 10 deletions
diff --git a/core/cochran.c b/core/cochran.c index 164b94bee..01f733043 100644 --- a/core/cochran.c +++ b/core/cochran.c @@ -785,7 +785,6 @@ static void cochran_parse_dive(const unsigned char *decode, unsigned mod, dc->duration.seconds = duration; } - dive->downloaded = true; record_dive_to_table(dive, table); mark_divelist_changed(true); diff --git a/core/dive.h b/core/dive.h index 674e52ec2..b9ec48824 100644 --- a/core/dive.h +++ b/core/dive.h @@ -309,7 +309,6 @@ struct dive { struct dive *next, **pprev; bool selected; bool hidden_by_filter; - bool downloaded; timestamp_t when; uint32_t dive_site_uuid; char *notes; diff --git a/core/libdivecomputer.c b/core/libdivecomputer.c index c182d2944..dec9ba4ea 100644 --- a/core/libdivecomputer.c +++ b/core/libdivecomputer.c @@ -861,7 +861,6 @@ static int dive_cb(const unsigned char *data, unsigned int size, add_dive_to_trip(dive, devdata->trip); } - dive->downloaded = true; record_dive_to_table(dive, devdata->download_table); mark_divelist_changed(true); return true; diff --git a/core/liquivision.c b/core/liquivision.c index 99641835c..b8e7ece2b 100644 --- a/core/liquivision.c +++ b/core/liquivision.c @@ -427,7 +427,6 @@ static void parse_dives (int log_version, const unsigned char *buf, unsigned int } // End dive - dive->downloaded = true; record_dive_to_table(dive, table); dive = NULL; mark_divelist_changed(true); diff --git a/core/uemis-downloader.c b/core/uemis-downloader.c index 129a48373..18d8c280e 100644 --- a/core/uemis-downloader.c +++ b/core/uemis-downloader.c @@ -197,7 +197,6 @@ static void uemis_get_weight(char *buffer, weightsystem_t *weight, int diveid) static struct dive *uemis_start_dive(uint32_t deviceid) { struct dive *dive = alloc_dive(); - dive->downloaded = true; dive->dc.model = strdup("Uemis Zurich"); dive->dc.deviceid = deviceid; return dive; @@ -1147,12 +1146,12 @@ static int get_memory(struct dive_table *td, int checkpoint) return UEMIS_MEM_OK; } -/* mark a dive as deleted by setting download to false - * this will be picked up by some cleaning statement later */ +/* we misuse the hidden_by_filter flag to mark a dive as deleted. + * this will be picked up by some cleaning statement later. */ static void do_delete_dives(struct dive_table *td, int idx) { for (int x = idx; x < td->nr; x++) - td->dives[x]->downloaded = false; + td->dives[x]->hidden_by_filter = true; } static bool load_uemis_divespot(const char *mountpath, int divespot_id) @@ -1265,7 +1264,7 @@ static bool get_matching_dive(int idx, char *newmax, int *uemis_mem_status, devi #endif deleted_files++; /* mark this log entry as deleted and cleanup later, otherwise we mess up our array */ - dive->downloaded = false; + dive->hidden_by_filter = true; #if UEMIS_DEBUG & 2 fprintf(debugfile, "Deleted dive from %s, with id %d from table -- newmax is %s\n", d_time, dive->dc.diveid, newmax); #endif @@ -1471,7 +1470,7 @@ const char *do_uemis_import(device_data_t *data) * to see if we have to clean some dead bodies from our download table */ next_table_index = 0; while (next_table_index < data->download_table->nr) { - if (!data->download_table->dives[next_table_index]->downloaded) + if (data->download_table->dives[next_table_index]->hidden_by_filter) uemis_delete_dive(data, data->download_table->dives[next_table_index]->dc.diveid); else next_table_index++; |