use QByteArray::left to send the newly received data during hydration

we use the proper method from QByteArray to forward the data received by
GETFileJob to the socket connected to teh fetch data CfApi callback

Close https://github.com/nextcloud/desktop/issues/6769

Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
This commit is contained in:
Matthieu Gallien 2024-08-06 16:39:41 +02:00 committed by Matthieu Gallien
parent 3fbab4c3e4
commit 8233b33d67

View File

@ -318,7 +318,7 @@ void GETFileJob::slotReadyRead()
return;
}
const qint64 writtenBytes = writeToDevice(QByteArray::fromRawData(buffer.constData(), readBytes));
const qint64 writtenBytes = writeToDevice(buffer.left(readBytes));
if (writtenBytes != readBytes) {
_errorString = _device->errorString();
_errorStatus = SyncFileItem::NormalError;