mirror of
https://github.com/subsurface/subsurface.git
synced 2025-01-19 14:25:27 +00:00
Ignore last dive read from Uemis when starting with empty divelist
When the user closes the divelist and starts with an empty file it makes no sense to assume that she only wants to download new dives since the last time dives have been downloaded. So if the current divelist is empty we ignore that information and start from the beginning again. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
6c52e8a2e5
commit
097702a392
1 changed files with 9 additions and 1 deletions
|
@ -792,7 +792,15 @@ static char *do_uemis_download(struct argument_block *args)
|
||||||
if (! uemis_get_answer(mountpath, "processSync", 0, 2, &result))
|
if (! uemis_get_answer(mountpath, "processSync", 0, 2, &result))
|
||||||
goto bail;
|
goto bail;
|
||||||
param_buff[1] = "notempty";
|
param_buff[1] = "notempty";
|
||||||
newmax = get_divenr(*max_dive_data, deviceid);
|
/* if we have an empty divelist then the user will almost
|
||||||
|
* certainly want to start downloading from the first dive on
|
||||||
|
* the Uemis; otherwise check which was the last dive
|
||||||
|
* downloaded */
|
||||||
|
if (dive_table.nr > 0)
|
||||||
|
newmax = get_divenr(*max_dive_data, deviceid);
|
||||||
|
else
|
||||||
|
newmax = strdup("0");
|
||||||
|
|
||||||
if (sscanf(newmax, "%d", &start) != 1)
|
if (sscanf(newmax, "%d", &start) != 1)
|
||||||
start = 0;
|
start = 0;
|
||||||
for (;;) {
|
for (;;) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue