Uemis Patch - display message if no files present to download

Guido Lerch guido.lerch at gmail.com
Fri Sep 25 07:32:25 PDT 2015


-- 
Best regards,
Guido
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.subsurface-divelog.org/pipermail/subsurface/attachments/20150925/8fc7915b/attachment.html>
-------------- next part --------------
From 9b6b28534e2102da18cdfed5b0d3401953217648 Mon Sep 17 00:00:00 2001
From: Guido Lerch <guido.lerch at gmail.com>
Date: Thu, 24 Sep 2015 19:26:35 +0200
Subject: [PATCH] Uemis-display message if no dives to download

Display an error message if no new files are there for
download.

Signed-off-by: Guido Lerch <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 3b8ddf9..deb82a9 100644
--- a/uemis-downloader.c
+++ b/uemis-downloader.c
@@ -27,6 +27,8 @@
 #define ERR_FS_ALMOST_FULL QT_TRANSLATE_NOOP("gettextFromC", "Uemis Zurich: the file system is almost full.\nDisconnect/reconnect the dive computer\nand click \'Retry\'")
 #define ERR_FS_FULL QT_TRANSLATE_NOOP("gettextFromC", "Uemis Zurich: the file system is full.\nDisconnect/reconnect the dive computer\nand click Retry")
 #define ERR_FS_SHORT_WRITE QT_TRANSLATE_NOOP("gettextFromC", "Short write to req.txt file.\nIs the Uemis Zurich plugged in correctly?")
+#define ERR_NO_FILES QT_TRANSLATE_NOOP("gettextFromC", "No files to download.")
+#define BUFLEN 2048
 #define BUFLEN 2048
 #define NUM_PARAM_BUFS 10
 
@@ -1345,5 +1347,7 @@ bail:
 	}
 	free(deviceid);
 	free(reqtxt_path);
+	if (!data->download_table->nr)
+		result = translate("gettextFromC", ERR_NO_FILES);
 	return result;
 }
-- 
2.3.8 (Apple Git-58)



More information about the subsurface mailing list