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
This commit is contained in:
Floris Bos 2022-08-18 15:37:37 +02:00
parent 2c00c64aba
commit 9c95398210

View file

@ -277,7 +277,7 @@ void ImageWriter::startWrite()
{ {
_thread = new LocalFileExtractThread(urlstr, _dst.toLatin1(), _expectedHash, this); _thread = new LocalFileExtractThread(urlstr, _dst.toLatin1(), _expectedHash, this);
} }
else if (compressed) else
{ {
_thread = new DownloadExtractThread(urlstr, _dst.toLatin1(), _expectedHash, this); _thread = new DownloadExtractThread(urlstr, _dst.toLatin1(), _expectedHash, this);
if (_repo.toString() == OSLIST_URL) if (_repo.toString() == OSLIST_URL)
@ -287,11 +287,6 @@ void ImageWriter::startWrite()
tele->start(); 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(success()), SLOT(onSuccess()));
connect(_thread, SIGNAL(error(QString)), SLOT(onError(QString))); connect(_thread, SIGNAL(error(QString)), SLOT(onError(QString)));