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-06 14:47:40 +0100 |
commit | b4282fd32ea06c1d634ea322f682a4c939a0cc89 (patch) | |
tree | 1994a3dc1609ce32f6a175c58b4f71c91389c2e6 /src/nfc | |
parent | 08fa2adc272ae58564601e92dc5d1459d8dc89ba (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>
(cherry picked from commit 539fce5bf6bb5b1e3d599ea6e41354c80a79500f)
Reviewed-by: Lars Schmertmann <lars.schmertmann@governikus.de>
Diffstat (limited to 'src/nfc')
-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 e9a6fa11..f7612d36 100644 --- a/src/nfc/qnearfieldtarget.cpp +++ b/src/nfc/qnearfieldtarget.cpp @@ -538,6 +538,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); |