Uemis patch - bug fix - make sure import reacts on cancel button

Guido Lerch guido.lerch at gmail.com
Wed Sep 16 00:14:01 PDT 2015


-- 
Best regards,
Guido
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.subsurface-divelog.org/pipermail/subsurface/attachments/20150916/ef46af05/attachment-0001.html>
-------------- next part --------------
From 9744dc1269058bce56020a494eab1d79dec13f6a Mon Sep 17 00:00:00 2001
From: glerch <guido.lerch at gmail.com>
Date: Wed, 16 Sep 2015 09:10:56 +0200
Subject: [PATCH 4/4] UEMIS-bugfix-import reacting on 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 at gmail.com>
---
 uemis-downloader.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/uemis-downloader.c b/uemis-downloader.c
index 92b221a..2f2f346 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;
-- 
1.9.5 (Apple Git-50.3)



More information about the subsurface mailing list