On Montag, 16. Oktober 2017 08:06:55 CEST Berthold Stoeger wrote:
> Dear all,
>
> On Sonntag, 15. Oktober 2017 22:08:52 CEST Berthold Stoeger wrote:
> > By the way, there seems to be a strange bug(?): for the first failed
> > download I get an information window. For each subsequent retry there is
> > an
> > additional window. E.g. for the 5th failed download it opens 5 information
> > windows at once.
>
> Answering to myself here: The issue seems to be the
> connect(&thread, SIGNAL(finished()), ...);
> call in on_downloadCancelRetryButton_clicked(), which apparently is
> accumulative. Moving this call to the constructor solves the "problem".
> That being said, I don't understand anything of that Qt SIGNAL/SLOT
> business. Moreover, there is a second connect call, which perhaps should
> also be called only once.
Related minor issue: by not clearing the error string of the thread a
successful download after a failed download would still show an error message.
Trivial patch attached. Not exactly sure where to put the error.clear()
though.
Berthold
>From 76933018a81750d04ad8a05a2676e3476022d455 Mon Sep 17 00:00:00 2001
From: Berthold Stoeger <[email protected]>
Date: Tue, 24 Oct 2017 00:27:52 +0200
Subject: [PATCH] Clear error string when starting dive computer download.
The error string of the download-from-divecomputer thread was not
cleared. Thus, if an error occured an error message was also shown
on subsequent successful downloads.
Signed-off-by: Berthold Stoeger <[email protected]>
---
core/downloadfromdcthread.cpp | 1 +
1 file changed, 1 insertion(+)
diff --git a/core/downloadfromdcthread.cpp b/core/downloadfromdcthread.cpp
index 2e6493d3..70b21489 100644
--- a/core/downloadfromdcthread.cpp
+++ b/core/downloadfromdcthread.cpp
@@ -43,6 +43,7 @@ void DownloadThread::run()
Q_ASSERT(internalData->download_table != nullptr);
const char *errorText;
import_thread_cancelled = false;
+ error.clear();
if (!strcmp(internalData->vendor, "Uemis"))
errorText = do_uemis_import(internalData);
else
--
2.14.1
_______________________________________________
subsurface mailing list
[email protected]
http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface