aboutsummaryrefslogtreecommitdiffstats
path: root/uemis-downloader.c
diff options
context:
space:
mode:
authorGravatar glerch <guido.lerch@gmail.com>2015-09-16 09:10:56 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2015-09-16 07:35:28 -0700
commite8ae51b8761d34b7af969af82c6a4fa08beddf1f (patch)
tree50f91efd7cb7ee3ff366a8be1630b76fe433384c /uemis-downloader.c
parent9d56165fd1e12ef5d3680779a03fa52fdcec3057 (diff)
downloadsubsurface-e8ae51b8761d34b7af969af82c6a4fa08beddf1f.tar.gz
Uuemis downloader: make sure import reacts to cancel
Fixed a bug where the import did not react on the cancel button by adding the check into the helper function as well. Signed-off-by: glerch <guido.lerch@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'uemis-downloader.c')
-rw-r--r--uemis-downloader.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/uemis-downloader.c b/uemis-downloader.c
index 92b221af2..2f2f34611 100644
--- a/uemis-downloader.c
+++ b/uemis-downloader.c
@@ -1094,6 +1094,8 @@ static bool get_matching_dive(int idx, int *dive_to_read, int *last_found_log_fi
snprintf(log_file_no_to_find, sizeof(log_file_no_to_find), "logfilenr{int{%d", dive->dc.diveid);
while (!found) {
+ if (import_thread_cancelled)
+ break;
snprintf(dive_to_read_buf, sizeof(dive_to_read_buf), "%d", *dive_to_read);
param_buff[2] = dive_to_read_buf;
(void)uemis_get_answer(mountpath, "getDive", 3, 0, NULL);
@@ -1273,6 +1275,8 @@ const char *do_uemis_import(device_data_t *data)
bool success = get_matching_dive(i, &dive_to_read, &last_found_log_file_nr, &deleted_files, newmax, &uemis_mem_status, data, mountpath, deviceidnr);
if (!success)
break;
+ if (import_thread_cancelled)
+ break;
}
start = end;