Uemis downloader: even with an empty divelist, check where to start

If the user hits retry from within the download dialog, the dive list
might still be empty but we still have to look for the best point to
restart.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Dirk Hohndel 2015-04-20 23:26:25 -07:00
parent 79f15e913b
commit 136282f88a

View file

@ -881,9 +881,9 @@ const char *do_uemis_import(device_data_t *data)
if (import_thread_cancelled)
goto bail;
param_buff[1] = "notempty";
/* if we have an empty divelist or force it, then we start downloading from the
* first dive on the Uemis; otherwise check which was the last dive downloaded */
if (!force_download && dive_table.nr > 0)
/* if we force it we start downloading from the first dive on the Uemis;
* otherwise check which was the last dive downloaded */
if (!force_download)
newmax = uemis_get_divenr(deviceid);
else
newmax = strdup("0");