diff options
author | Christian Kamm <mail@ckamm.de> | 2018-06-13 15:20:21 +0300 |
---|---|---|
committer | ckamm <mail@ckamm.de> | 2018-06-13 17:44:24 +0300 |
commit | ad2446b0360a22d412f30131bd9d6f2f20ac5134 (patch) | |
tree | 40d3c950fec4ebddf8704d4a9f5d608639fd18ab /test/syncenginetestutils.h | |
parent | 9c66dbb2b77a581d56a4ef1000c8e55410e56cfb (diff) |
Ensure GETFileJob notices finishing #6581
It could happen that readyRead was emitted for incoming data while the
download was not yet finished. Then the network job could finish with
no more data arriving - so readyRead wasn't emitted again.
To fix this, the finished signal also gets connected to the readyRead
slot.
Diffstat (limited to 'test/syncenginetestutils.h')
-rw-r--r-- | test/syncenginetestutils.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/test/syncenginetestutils.h b/test/syncenginetestutils.h index 3957479d6..e0982bd15 100644 --- a/test/syncenginetestutils.h +++ b/test/syncenginetestutils.h @@ -729,10 +729,17 @@ public: setError(InternalServerError, "Internal Server Fake Error"); emit metaDataChanged(); emit readyRead(); + // finishing can come strictly after readyRead was called + QTimer::singleShot(5, this, &FakeErrorReply::slotSetFinished); + } + +public slots: + void slotSetFinished() { setFinished(true); emit finished(); } +public: void abort() override { } qint64 readData(char *buf, qint64 max) override { max = qMin<qint64>(max, _body.size()); |