Fix wrong size being passed (QString::size -> QFile::size)

Fixes test
This commit is contained in:
Albert Vaca Cintora 2019-02-13 00:09:57 +01:00
parent a8e9c0d002
commit 8142a2c92f

View file

@ -109,7 +109,8 @@ class TestSendFile : public QObject
QSharedPointer<QFile> f(new QFile(aFile)); QSharedPointer<QFile> f(new QFile(aFile));
NetworkPacket np(PACKET_TYPE_SHARE_REQUEST); NetworkPacket np(PACKET_TYPE_SHARE_REQUEST);
np.setPayload(f, aFile.size()); np.setPayload(f, f->size());
CompositeUploadJob* job = new CompositeUploadJob(deviceId, false); CompositeUploadJob* job = new CompositeUploadJob(deviceId, false);
UploadJob* uj = new UploadJob(np); UploadJob* uj = new UploadJob(np);
job->addSubjob(uj); job->addSubjob(uj);
@ -119,7 +120,7 @@ class TestSendFile : public QObject
f->open(QIODevice::ReadWrite); f->open(QIODevice::ReadWrite);
FileTransferJob* ft = new FileTransferJob(f, aFile.size(), QUrl::fromLocalFile(destFile)); FileTransferJob* ft = np.createPayloadTransferJob(QUrl::fromLocalFile(destFile));
QSignalSpy spyTransfer(ft, &KJob::result); QSignalSpy spyTransfer(ft, &KJob::result);