From 9c953982109cc09819d4fffdeb4302b2aca55e92 Mon Sep 17 00:00:00 2001 From: Floris Bos Date: Thu, 18 Aug 2022 15:37:37 +0200 Subject: [PATCH] Ensure buffering is used when writing uncompressed images Just feed them through the libarchive workflow as well. Prevents issues on Windows/osx when writing uncompressed images that come from the Internet. Ref #473 --- src/imagewriter.cpp | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/imagewriter.cpp b/src/imagewriter.cpp index 37e024b..c598d84 100644 --- a/src/imagewriter.cpp +++ b/src/imagewriter.cpp @@ -277,7 +277,7 @@ void ImageWriter::startWrite() { _thread = new LocalFileExtractThread(urlstr, _dst.toLatin1(), _expectedHash, this); } - else if (compressed) + else { _thread = new DownloadExtractThread(urlstr, _dst.toLatin1(), _expectedHash, this); if (_repo.toString() == OSLIST_URL) @@ -287,11 +287,6 @@ void ImageWriter::startWrite() tele->start(); } } - else - { - _thread = new DownloadThread(urlstr, _dst.toLatin1(), _expectedHash, this); - _thread->setInputBufferSize(IMAGEWRITER_UNCOMPRESSED_BLOCKSIZE); - } connect(_thread, SIGNAL(success()), SLOT(onSuccess())); connect(_thread, SIGNAL(error(QString)), SLOT(onError(QString)));