Notify QNAM about the file received size

This commit is contained in:
Aleix Pol 2015-09-11 17:03:11 +02:00
parent c2acc37da6
commit 9fedfcdb3d

View file

@ -82,7 +82,10 @@ void FileTransferJob::startTransfer()
mDeviceName),
QPair<QString, QString>(i18nc("File transfer destination", "To"), mDestination.toLocalFile()));
mReply = Daemon::instance()->networkAccessManager()->put(QNetworkRequest(mDestination), mOrigin.data());
QNetworkRequest req(mDestination);
req.setHeader(QNetworkRequest::ContentLengthHeader, totalAmount(Bytes));
mReply = Daemon::instance()->networkAccessManager()->put(req, mOrigin.data());
connect(mReply, &QNetworkReply::uploadProgress, this, [this](qint64 bytesSent, qint64 /*bytesTotal*/) {
setProcessedAmount(Bytes, bytesSent);
emitSpeed(bytesSent/mTime.elapsed());