diff options
author | Alex Blasche <alexander.blasche@theqtcompany.com> | 2016-04-06 12:38:16 +0200 |
---|---|---|
committer | Alex Blasche <alexander.blasche@theqtcompany.com> | 2016-04-13 07:46:59 +0000 |
commit | aecf1408552a440b81b1157c4f701533833c09c8 (patch) | |
tree | 3ba6f9118b3ed18504edde988db253bdac7603d1 /examples | |
parent | 20b0a09547131cf0d01f7373735c4382843461bd (diff) |
Fix Annotated URL Example on Android
QNearFieldManager::registerNdefMessageHandler() is supposed to register
the current app as platform handler for certain tag types. The example
is written around this concept and doesn't start the target detection
when such a registration succeeded.
Unfortunately the Android implementation does something completely
different. Therefore the startTargetDetection() and connect() calls
after the current return is necessary to make the example useful.
For now we simply ignore the feature and always start target
detection. Since neither NEARD/Linux nor Android (the only two
supported platforms) have an implementation for the feature
the modified example works as expected.
Considering the current state it should be considered to remove
this NDEF message registration feature in Qt 6 altogether. The only platform
which ever supported the feature was BB10 and its implementation was
removed a long time ago.
Task-number: QTBUG-52154
Change-Id: Ibef9e77ac33b9629b6d81aa70eaa01ab1702cfcb
Reviewed-by: Peter Rustler <peter.rustler@basyskom.com>
Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
Diffstat (limited to 'examples')
-rw-r--r-- | examples/nfc/annotatedurl/annotatedurl.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/examples/nfc/annotatedurl/annotatedurl.cpp b/examples/nfc/annotatedurl/annotatedurl.cpp index cf7dd17a..a07aadcc 100644 --- a/examples/nfc/annotatedurl/annotatedurl.cpp +++ b/examples/nfc/annotatedurl/annotatedurl.cpp @@ -77,8 +77,8 @@ AnnotatedUrl::AnnotatedUrl(QObject *parent) SLOT(handleMessage(QNdefMessage,QNearFieldTarget*))); //! [QNearFieldManager register handler] - if (result != -1) - return; + if (result < 0) + qWarning() << "Platform does not support NDEF message handler registration"; manager->startTargetDetection(); connect(manager, SIGNAL(targetDetected(QNearFieldTarget*)), |