From 9fedfcdb3d216ef4547bd4ebfd7661a01e177e13 Mon Sep 17 00:00:00 2001 From: Aleix Pol Date: Fri, 11 Sep 2015 17:03:11 +0200 Subject: [PATCH] Notify QNAM about the file received size --- core/filetransferjob.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/core/filetransferjob.cpp b/core/filetransferjob.cpp index 86ef79923..46c84e270 100644 --- a/core/filetransferjob.cpp +++ b/core/filetransferjob.cpp @@ -82,7 +82,10 @@ void FileTransferJob::startTransfer() mDeviceName), QPair(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());