diff options
author | Lars Schmertmann <Lars.Schmertmann@governikus.de> | 2020-02-24 14:34:20 +0100 |
---|---|---|
committer | Lars Schmertmann <Lars.Schmertmann@governikus.de> | 2020-03-05 10:27:32 +0100 |
commit | 539fce5bf6bb5b1e3d599ea6e41354c80a79500f (patch) | |
tree | 62f3f0beb5e16e59f2b88272c4acd445553dfe47 /src | |
parent | 962f282d21e62b8ddc170cd62cbd918f56493ab8 (diff) |
Also add a response for a request if reportError is called
When using QNearFieldTarget::sendCommand on Android an exception can
occur. In this case reportError is called and handleResponse is omitted.
A call to QNearFieldTarget::waitForRequestCompleted will result in
a full usage of the specified timeout, even if the exception occurred.
To avoid this behavior also add an (invalid) response in reportError.
Change-Id: Id80b7a97da5628d229b942803ec1a2fb13536d99
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
Diffstat (limited to 'src')
-rw-r--r-- | src/nfc/qnearfieldtarget.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/nfc/qnearfieldtarget.cpp b/src/nfc/qnearfieldtarget.cpp index 2905c380..814747a4 100644 --- a/src/nfc/qnearfieldtarget.cpp +++ b/src/nfc/qnearfieldtarget.cpp @@ -544,6 +544,7 @@ bool QNearFieldTarget::handleResponse(const QNearFieldTarget::RequestId &id, void QNearFieldTarget::reportError(QNearFieldTarget::Error error, const QNearFieldTarget::RequestId &id) { + setResponseForRequest(id, QVariant(), false); QMetaObject::invokeMethod(this, [this, error, id]() { Q_EMIT this->error(error, id); }, Qt::QueuedConnection); |