From 7c48afd6eb29f02e197cd55903601bd6c882239b Mon Sep 17 00:00:00 2001 From: Christophe Dumez Date: Sun, 22 Jul 2007 12:08:16 +0000 Subject: [PATCH] - Improved downloadThread aborting support --- src/downloadThread.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/downloadThread.h b/src/downloadThread.h index 0087ba442..0202ac655 100644 --- a/src/downloadThread.h +++ b/src/downloadThread.h @@ -139,8 +139,12 @@ class downloadThread : public QThread { while(!url_stream.eof()) { url_stream.read(cbuf, sizeof(cbuf)); len = url_stream.gcount(); - if(len > 0){ + if(len > 0) dest_file.write(cbuf, len); + if(abort){ + dest_file.close(); + url_stream.close(); + return; } } dest_file.close();